Completes: U4-2893 Remove the entire umbraco.macroRenderings assembly

This commit is contained in:
Shannon
2013-10-04 10:01:57 +10:00
parent ad6e4ae745
commit ff3aebd4b1
22 changed files with 88 additions and 931 deletions

View File

@@ -4,7 +4,7 @@ using System.Web.UI;
using System.Web.UI.WebControls;
using umbraco.cms.businesslogic.datatype;
using umbraco.cms.businesslogic.relation;
using umbraco.macroRenderings;
namespace umbraco.editorControls.PickerRelations
{
@@ -19,7 +19,7 @@ namespace umbraco.editorControls.PickerRelations
/// Prepopulated Umbraco Propery Picker, lists all aliases (could refine this by asking for the context in which this relation wire-up will
/// be used, and then only listing the aliases for that context)
/// </summary>
private propertyTypePicker pickerPropertyAliasPicker = new propertyTypePicker();
private PropertyTypePicker pickerPropertyAliasPicker = new PropertyTypePicker();
/// <summary>
/// RequiredFieldValidator for the ProperyAliasPicker

View File

@@ -0,0 +1,83 @@
using System;
using System.Collections;
using System.Linq;
namespace umbraco.editorControls
{
/// <summary>
/// Summary description for propertyTypePicker.
/// </summary>
public class PropertyTypePicker : System.Web.UI.WebControls.ListBox, interfaces.IMacroGuiRendering
{
string _value = "";
bool _multiple = false;
public bool ShowCaption
{
get {return true;}
}
public virtual bool Multiple
{
set {_multiple = value;}
get {return _multiple;}
}
public string Value
{
get
{
string retVal = "";
foreach(System.Web.UI.WebControls.ListItem i in base.Items)
if (i.Selected)
retVal += i.Value + ",";
if (retVal != "")
retVal = retVal.Substring(0, retVal.Length-1);
return retVal;
}
set
{
_value = value;
}
}
protected override void OnInit(EventArgs e)
{
base.OnInit (e);
this.CssClass = "guiInputTextStandard";
// Check for multiple choises
if (_multiple)
{
this.SelectionMode = System.Web.UI.WebControls.ListSelectionMode.Multiple;
this.Rows = 5;
this.Multiple =true;
}
else
{
this.Rows = 1;
this.Items.Add(new System.Web.UI.WebControls.ListItem("", ""));
this.SelectionMode = System.Web.UI.WebControls.ListSelectionMode.Single;
}
Hashtable ht = new Hashtable();
foreach(cms.businesslogic.propertytype.PropertyType pt in cms.businesslogic.propertytype.PropertyType.GetAll().OrderBy(x => x.Name))
{
if (!ht.ContainsKey(pt.Alias))
{
System.Web.UI.WebControls.ListItem li = new System.Web.UI.WebControls.ListItem(pt.Alias);
if (((string) (", "+_value+",")).IndexOf(", "+pt.Alias+",") > -1)
li.Selected = true;
ht.Add(pt.Alias, "");
this.Items.Add(li);
}
}
}
}
}

View File

@@ -5,7 +5,6 @@ using umbraco.BusinessLogic;
using umbraco.editorControls;
using umbraco.DataLayer;
using umbraco.interfaces;
using umbraco.macroRenderings;
namespace umbraco.editorControls.imagecropper
{
@@ -14,7 +13,7 @@ namespace umbraco.editorControls.imagecropper
{
private readonly umbraco.cms.businesslogic.datatype.BaseDataType _dataType;
private propertyTypePicker imagePropertyTypePicker; // this has replaced txtPropertyAlias (a textbox used to enter a property alias)
private PropertyTypePicker imagePropertyTypePicker; // this has replaced txtPropertyAlias (a textbox used to enter a property alias)
private RequiredFieldValidator imagePropertyRequiredFieldValidator;
private CheckBox chkGenerateCrops;
@@ -48,7 +47,7 @@ namespace umbraco.editorControls.imagecropper
public void SetupChildControls()
{
this.imagePropertyTypePicker = new propertyTypePicker() { ID = "imagePropertyTypePicker" };
this.imagePropertyTypePicker = new PropertyTypePicker() { ID = "imagePropertyTypePicker" };
this.imagePropertyRequiredFieldValidator = new RequiredFieldValidator()
{
ID = "imagePropertyRequiredFieldValidator",

View File

@@ -170,10 +170,6 @@
<Project>{511F6D8D-7717-440A-9A57-A507E9A8B27F}</Project>
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
</ProjectReference>
<ProjectReference Include="..\umbraco.macroRenderings\umbraco.macroRenderings.csproj">
<Project>{52AB8F1F-FB76-4E8C-885F-0747B6CE71EC}</Project>
<Name>umbraco.macroRenderings</Name>
</ProjectReference>
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
</ItemGroup>
@@ -330,6 +326,7 @@
<SubType>Code</SubType>
</Compile>
<Compile Include="PrevalueEditorExtensions.cs" />
<Compile Include="PropertyTypePicker.cs" />
<Compile Include="radiobuttonlist\radiobox.cs">
<SubType>Code</SubType>
</Compile>