Пример #1
0
 /// <summary>
 /// Creates a new <see cref="UserMenuItem"/> object from given <see cref="MenuItemDefinition"/>.
 /// </summary>
 internal UserMenuItem(MenuItemDefinition menuItemDefinition, ILocalizationContext localizationContext)
 {
     Name        = menuItemDefinition.Name;
     Icon        = menuItemDefinition.Icon;
     DisplayName = menuItemDefinition.DisplayName.Localize(localizationContext);
     Order       = menuItemDefinition.Order;
     Url         = menuItemDefinition.Url;
     CustomData  = menuItemDefinition.CustomData;
     Items       = new List <UserMenuItem>();
 }
Пример #2
0
 /// <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)
 {
     Items.Add(menuItem);
     return(this);
 }