using System.Collections; using System.Collections.Generic; using System.Runtime.Serialization; namespace Umbraco.Web.Trees.Menu { /// /// A menu item collection for a given tree node /// [DataContract(Name = "menuItems", Namespace = "")] public class MenuItemCollection { private readonly MenuItemList _menuItems = new MenuItemList(); public MenuItemCollection() { } public MenuItemCollection(IEnumerable items) { _menuItems = new MenuItemList(items); } /// /// Sets the default menu item alias to be shown when the menu is launched - this is optional and if not set then the menu will just be shown normally. /// [DataMember(Name = "defaultAlias")] public string DefaultMenuAlias { get; set; } /// /// The list of menu items /// /// /// We require this so the json serialization works correctly /// [DataMember(Name = "menuItems")] public MenuItemList Items { get { return _menuItems; } } } }