Class MenuItemList
A custom menu list
Namespace: Umbraco.Web.Models.Trees
Assembly: Umbraco.Web.dll
Syntax
public class MenuItemList : List<MenuItem>, IList<MenuItem>, ICollection<MenuItem>, IList, ICollection, IReadOnlyList<MenuItem>, IReadOnlyCollection<MenuItem>, IEnumerable<MenuItem>, IEnumerable
Remarks
NOTE: We need a sub collection to the MenuItemCollection object due to how json serialization works.
Constructors
View SourceMenuItemList()
Declaration
public MenuItemList()
MenuItemList(IEnumerable<MenuItem>)
Declaration
public MenuItemList(IEnumerable<MenuItem> items)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<MenuItem> | items |
Methods
View SourceAdd<T>(String, Boolean, Boolean)
Adds a menu item with a dictionary which is merged to the AdditionalData bag
Declaration
public MenuItem Add<T>(string name, bool hasSeparator = false, bool opensDialog = false)
where T : IAction
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The text to display for the menu item, will default to the IAction alias if not specified |
System.Boolean | hasSeparator | |
System.Boolean | opensDialog | Whether or not this action opens a dialog |
Returns
Type | Description |
---|---|
MenuItem |
Type Parameters
Name | Description |
---|---|
T |
Add<T>(ILocalizedTextService, Boolean, Boolean)
Adds a menu item with a dictionary which is merged to the AdditionalData bag
Declaration
public MenuItem Add<T>(ILocalizedTextService textService, bool hasSeparator = false, bool opensDialog = false)
where T : IAction
Parameters
Type | Name | Description |
---|---|---|
ILocalizedTextService | textService | The ILocalizedTextService used to localize the action name based on it's alias |
System.Boolean | hasSeparator | |
System.Boolean | opensDialog | Whether or not this action opens a dialog |
Returns
Type | Description |
---|---|
MenuItem |
Type Parameters
Name | Description |
---|---|
T |