porting 7.6-rc1 into 8
This commit is contained in:
@@ -15,7 +15,7 @@ namespace Umbraco.Core.Models
|
||||
{
|
||||
public MacroProperty()
|
||||
{
|
||||
|
||||
_key = Guid.NewGuid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -30,6 +30,7 @@ namespace Umbraco.Core.Models
|
||||
_alias = alias;
|
||||
_name = name;
|
||||
_sortOrder = sortOrder;
|
||||
_key = Guid.NewGuid();
|
||||
|
||||
//try to get the new mapped parameter editor
|
||||
var mapped = LegacyParameterEditorAliasConverter.GetNewAliasFromLegacyAlias(editorAlias, false);
|
||||
@@ -45,16 +46,18 @@ namespace Umbraco.Core.Models
|
||||
/// Ctor for creating an existing property
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="alias"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="sortOrder"></param>
|
||||
/// <param name="editorAlias"></param>
|
||||
internal MacroProperty(int id, string @alias, string name, int sortOrder, string editorAlias)
|
||||
internal MacroProperty(int id, Guid key, string @alias, string name, int sortOrder, string editorAlias)
|
||||
{
|
||||
_id = id;
|
||||
_alias = alias;
|
||||
_name = name;
|
||||
_sortOrder = sortOrder;
|
||||
_key = key;
|
||||
|
||||
//try to get the new mapped parameter editor
|
||||
var mapped = LegacyParameterEditorAliasConverter.GetNewAliasFromLegacyAlias(editorAlias, false);
|
||||
@@ -66,6 +69,7 @@ namespace Umbraco.Core.Models
|
||||
_editorAlias = editorAlias;
|
||||
}
|
||||
|
||||
private Guid _key;
|
||||
private string _alias;
|
||||
private string _name;
|
||||
private int _sortOrder;
|
||||
@@ -76,6 +80,7 @@ namespace Umbraco.Core.Models
|
||||
|
||||
private class PropertySelectors
|
||||
{
|
||||
public readonly PropertyInfo KeySelector = ExpressionHelper.GetPropertyInfo<MacroProperty, Guid>(x => x.Key);
|
||||
public readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<MacroProperty, string>(x => x.Alias);
|
||||
public readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<MacroProperty, string>(x => x.Name);
|
||||
public readonly PropertyInfo SortOrderSelector = ExpressionHelper.GetPropertyInfo<MacroProperty, int>(x => x.SortOrder);
|
||||
@@ -83,6 +88,16 @@ namespace Umbraco.Core.Models
|
||||
public readonly PropertyInfo PropertyTypeSelector = ExpressionHelper.GetPropertyInfo<MacroProperty, string>(x => x.EditorAlias);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Key of the Property
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public Guid Key
|
||||
{
|
||||
get { return _key; }
|
||||
set { SetPropertyValueAndDetectChanges(value, ref _key, Ps.Value.KeySelector); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Alias of the Property
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user