Files
Umbraco-CMS/src/Umbraco.Core/Models/MacroPropertyCollection.cs

29 lines
735 B
C#
Raw Normal View History

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>
public class MacroPropertyCollection : ObservableDictionary<string, IMacroProperty>, IDeepCloneable
2013-11-07 17:16:22 +01:00
{
public MacroPropertyCollection()
: base(property => property.Alias)
{
}
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
}
}