2013-11-07 17:16:22 +01:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Core.Models
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// A macro's property collection
|
|
|
|
|
|
/// </summary>
|
2014-05-12 13:48:56 +10:00
|
|
|
|
public class MacroPropertyCollection : ObservableDictionary<string, IMacroProperty>, IDeepCloneable
|
2013-11-07 17:16:22 +01:00
|
|
|
|
{
|
|
|
|
|
|
public MacroPropertyCollection()
|
|
|
|
|
|
: base(property => property.Alias)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2014-05-12 13:48:56 +10:00
|
|
|
|
public object DeepClone()
|
|
|
|
|
|
{
|
|
|
|
|
|
var clone = new MacroPropertyCollection();
|
|
|
|
|
|
foreach (var item in this)
|
|
|
|
|
|
{
|
|
|
|
|
|
clone.Add((IMacroProperty)item.DeepClone());
|
|
|
|
|
|
}
|
|
|
|
|
|
return clone;
|
|
|
|
|
|
}
|
2013-11-07 17:16:22 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2013-09-17 17:18:54 +10:00
|
|
|
|
}
|