Remove legacy refs from Umbraco.Web.UI

This commit is contained in:
Stephan
2017-06-19 09:41:58 +02:00
parent c369c93710
commit 3bf232ec3c
9 changed files with 225 additions and 24 deletions

View File

@@ -173,11 +173,9 @@
-->
</ItemGroup>
<ItemGroup>
<!--
Which means we also have to have explicit references here ;(
-->
<Reference Include="System.Security.Cryptography.Algorithms">
<HintPath>..\packages\System.Security.Cryptography.Algorithms.4.2.0\lib\net461\System.Security.Cryptography.Algorithms.dll</HintPath>
<Private>True</Private>
@@ -455,21 +453,9 @@
<ProjectReference Include="..\UmbracoExamine\UmbracoExamine.csproj">
<Name>UmbracoExamine</Name>
</ProjectReference>
<ProjectReference Include="..\SQLCE4Umbraco\SqlCE4Umbraco.csproj">
<Name>SqlCE4Umbraco</Name>
</ProjectReference>
<ProjectReference Include="..\Umbraco.Core\Umbraco.Core.csproj">
<Name>Umbraco.Core</Name>
</ProjectReference>
<ProjectReference Include="..\umbraco.controls\umbraco.controls.csproj">
<Name>umbraco.controls</Name>
</ProjectReference>
<ProjectReference Include="..\umbraco.cms\umbraco.cms.csproj">
<Name>umbraco.cms</Name>
</ProjectReference>
<ProjectReference Include="..\umbraco.datalayer\umbraco.datalayer.csproj">
<Name>umbraco.datalayer</Name>
</ProjectReference>
<ProjectReference Include="..\Umbraco.Web\Umbraco.Web.csproj">
<Name>Umbraco.Web</Name>
</ProjectReference>

View File

@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
@@ -9,7 +8,6 @@ using System.Web.UI;
using Umbraco.Core;
using Umbraco.Core.IO;
using Umbraco.Web.UI.Pages;
using umbraco.BusinessLogic;
namespace Umbraco.Web.UI.Umbraco.Developer.Packages
{

View File

@@ -28,7 +28,7 @@ namespace Umbraco.Web.UI.Umbraco.Developer.Packages {
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::umbraco.uicontrols.Pane pane;
protected global::Umbraco.Web._Legacy.Controls.Pane pane;
/// <summary>
/// Output control.

View File

@@ -19,7 +19,7 @@ namespace Umbraco.Web.UI.Umbraco.Dialogs {
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::umbraco.uicontrols.Pane ChangeDocTypePane;
protected global::Umbraco.Web._Legacy.Controls.Pane ChangeDocTypePane;
/// <summary>
/// ContentNamePropertyPanel control.
@@ -28,7 +28,7 @@ namespace Umbraco.Web.UI.Umbraco.Dialogs {
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::umbraco.uicontrols.PropertyPanel ContentNamePropertyPanel;
protected global::Umbraco.Web._Legacy.Controls.PropertyPanel ContentNamePropertyPanel;
/// <summary>
/// ContentNameLabel control.
@@ -46,7 +46,7 @@ namespace Umbraco.Web.UI.Umbraco.Dialogs {
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::umbraco.uicontrols.PropertyPanel CurrentTypePropertyPanel;
protected global::Umbraco.Web._Legacy.Controls.PropertyPanel CurrentTypePropertyPanel;
/// <summary>
/// CurrentTypeLabel control.
@@ -64,7 +64,7 @@ namespace Umbraco.Web.UI.Umbraco.Dialogs {
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::umbraco.uicontrols.PropertyPanel NewTypePropertyPanel;
protected global::Umbraco.Web._Legacy.Controls.PropertyPanel NewTypePropertyPanel;
/// <summary>
/// NewDocumentTypeList control.
@@ -91,7 +91,7 @@ namespace Umbraco.Web.UI.Umbraco.Dialogs {
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::umbraco.uicontrols.PropertyPanel NewTemplatePropertyPanel;
protected global::Umbraco.Web._Legacy.Controls.PropertyPanel NewTemplatePropertyPanel;
/// <summary>
/// NewTemplateList control.
@@ -118,7 +118,7 @@ namespace Umbraco.Web.UI.Umbraco.Dialogs {
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::umbraco.uicontrols.Pane ChangeDocTypePropertyMappingPane;
protected global::Umbraco.Web._Legacy.Controls.Pane ChangeDocTypePropertyMappingPane;
/// <summary>
/// PropertyMappingRepeater control.

View File

@@ -46,6 +46,6 @@ namespace Umbraco.Web.UI.Umbraco.Dialogs {
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::umbraco.uicontrols.ProgressBar ProgBar1;
protected global::Umbraco.Web._Legacy.Controls.ProgressBar ProgBar1;
}
}

View File

@@ -999,6 +999,9 @@
<Compile Include="Trees\PartialViewsTreeController.cs" />
<Compile Include="UI\Controls\InsertMacroSplitButton.cs" />
<Compile Include="UI\IAssignedApp.cs" />
<Compile Include="_Legacy\Controls\pane.cs" />
<Compile Include="_Legacy\Controls\ProgressBar.cs" />
<Compile Include="_Legacy\Controls\PropertyPanel.cs" />
<Compile Include="_Legacy\PackageActions\addApplication.cs" />
<Compile Include="_Legacy\PackageActions\addApplicationTree.cs" />
<Compile Include="_Legacy\PackageActions\addDashboardSection.cs" />

View File

@@ -0,0 +1,24 @@
using System;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.Services;
namespace Umbraco.Web._Legacy.Controls
{
[Obsolete("Use Umbraco.Web.UI.Controls.ProgressBar")]
public class ProgressBar : System.Web.UI.WebControls.Panel
{
private string _title = Current.Services.TextService.Localize("publish/inProgress");
public string Title { get; set; }
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
if(!string.IsNullOrEmpty(Title))
_title = Title;
base.CssClass = "umb-loader";
base.Render(writer);
}
}
}

View File

@@ -0,0 +1,73 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI;
namespace Umbraco.Web._Legacy.Controls
{
public class PropertyPanel : System.Web.UI.WebControls.Panel
{
private Control _control;
private string _text = string.Empty;
public string Text
{
get { return _text; }
set { _text = value; }
}
protected override void OnLoad(EventArgs eventArguments)
{
}
protected override void Render(HtmlTextWriter writer)
{
ViewStateMode = ViewStateMode.Disabled;
CreateChildControls();
if (string.IsNullOrEmpty(_text))
CssClass += " hidelabel";
writer.WriteLine("<div class=\"umb-el-wrap " + CssClass + "\">");
if (_text != string.Empty)
{
if (_control == null)
{
_control = Controls.OfType<Control>().FirstOrDefault(c => c.Visible && (c.GetType().Name.Contains("Literal") == false));
}
if (_control == null)
{
writer.WriteLine("<span class=\"control-label\">{0}</span>", _text);
}
else
{
writer.WriteLine("<label class=\"control-label\" for=\"{0}\">{1}</label>", _control != null ? _control.ClientID : "", _text);
}
}
writer.WriteLine("<div class=\"controls controls-row\">");
try
{
this.RenderChildren(writer);
}
catch (Exception ex)
{
writer.WriteLine("Error creating control <br />");
writer.WriteLine(ex.ToString());
}
writer.WriteLine("</div></div>");
}
}
}

View File

@@ -0,0 +1,117 @@
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using ClientDependency.Core;
namespace Umbraco.Web._Legacy.Controls
{
public class Pane : System.Web.UI.WebControls.Panel
{
public Pane()
{
}
private string m_Text = string.Empty;
public string Text
{
get { return m_Text; }
set { m_Text = value; }
}
private string m_title = string.Empty;
public string Title
{
get { return m_title; }
set { m_title = value; }
}
public void addProperty(string Caption, Control C, params BaseValidator[] validators)
{
PropertyPanel pp = new PropertyPanel();
pp.Controls.Add(C);
foreach (var validator in validators)
{
validator.Display = ValidatorDisplay.Dynamic;
pp.Controls.Add(validator);
}
pp.Text = Caption;
this.Controls.Add(pp);
}
public void addProperty(string Caption, Control C)
{
PropertyPanel pp = new PropertyPanel();
pp.Controls.Add(C);
pp.Text = Caption;
this.Controls.Add(pp);
}
public void addProperty(Control ctrl)
{
PropertyPanel pp = new PropertyPanel();
pp.Controls.Add(ctrl);
this.Controls.Add(pp);
}
protected override void OnLoad(System.EventArgs EventArguments)
{
}
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
this.ViewStateMode = ViewStateMode.Disabled;
this.CreateChildControls();
string styleString = "";
foreach (string key in this.Style.Keys)
{
styleString += key + ":" + this.Style[key] + ";";
}
writer.WriteLine("<div class=\"umb-pane " + this.CssClass + "\" style='" + styleString + "'>");
if (!string.IsNullOrEmpty(m_title))
writer.WriteLine("<h5 class='umb-pane-title'>" + m_title + "</h5>");
writer.WriteLine("<div class=\"control-group umb-control-group\" style='" + styleString + "'>");
if (!string.IsNullOrEmpty(m_Text))
writer.WriteLine("<p class=\"umb-abstract\">" + m_Text + "</p>");
try
{
this.RenderChildren(writer);
}
catch (Exception ex)
{
writer.WriteLine("Error creating control <br />");
writer.WriteLine(ex.ToString());
}
writer.WriteLine("</div>");
writer.WriteLine("</div>");
}
}
}