/// <summary> /// Creates a new <see cref="UserMenuItem"/> object from given <see cref="MenuItemDefinition"/>. /// </summary> internal UserMenuItem(MenuItemDefinition menuItemDefinition, ILocalizationContext localizationContext) { this.Name = menuItemDefinition.Name; this.Icon = menuItemDefinition.Icon; this.DisplayName = menuItemDefinition.DisplayName.Localize(localizationContext); this.Order = menuItemDefinition.Order; this.Url = menuItemDefinition.Url; this.CustomData = menuItemDefinition.CustomData; this.Target = menuItemDefinition.Target; this.Items = new List <UserMenuItem>(); }
/// <summary> /// Adds a <see cref="MenuItemDefinition"/> to <see cref="Items"/>. /// </summary> /// <param name="menuItem"><see cref="MenuItemDefinition"/> to be added</param> /// <returns>This <see cref="MenuDefinition"/> object</returns> public MenuDefinition AddItem(MenuItemDefinition menuItem) { this.Items.Add(menuItem); return(this); }