Example #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;
            Target      = menuItemDefinition.Target;

            Items = new List <UserMenuItem>();
        }
Example #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="MenuItemDefinition"/> object</returns>
 public MenuItemDefinition AddItem(MenuItemDefinition menuItem)
 {
     Items.Add(menuItem);
     return(this);
 }