Esempio n. 1
0
        /// <summary>
        /// Creates a new <see cref="UserMenuItem"/> object from given <see cref="MenuItemDefinition"/>.
        /// </summary>
        internal UserMenuItem(MenuItemDefinition menuItemDefinition, IStringLocalizerFactory localizerFactory)
        {
            Name        = menuItemDefinition.Name;
            Icon        = menuItemDefinition.Icon;
            DisplayName = menuItemDefinition.DisplayName.Localize(localizerFactory);
            Order       = menuItemDefinition.Order;
            Url         = menuItemDefinition.Url;
            CustomData  = menuItemDefinition.CustomData;
            Target      = menuItemDefinition.Target;
            Enabled     = menuItemDefinition.Enabled;
            Visible     = menuItemDefinition.Visible;

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