Class MenuItemList
A custom menu list
Inheritance
System.Object
Namespace: Umbraco.Cms.Core.Trees
Assembly: Umbraco.Core.dll
Syntax
public class MenuItemList : List<MenuItem>
Remarks
NOTE: We need a sub collection to the MenuItemCollection object due to how json serialization works.
Constructors
View SourceMenuItemList(ActionCollection)
Declaration
public MenuItemList(ActionCollection actionCollection)
Parameters
Type | Name | Description |
---|---|---|
ActionCollection | actionCollection |
MenuItemList(ActionCollection, IEnumerable<MenuItem>)
Declaration
public MenuItemList(ActionCollection actionCollection, IEnumerable<MenuItem> items)
Parameters
Type | Name | Description |
---|---|---|
ActionCollection | actionCollection | |
IEnumerable<MenuItem> | items |
Methods
View SourceAdd<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 its alias |
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, 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, bool useLegacyIcon = true)
where T : IAction
Parameters
Type | Name | Description |
---|---|---|
ILocalizedTextService | textService | The ILocalizedTextService used to localize the action name based on its alias |
System.Boolean | hasSeparator | |
System.Boolean | opensDialog | Whether or not this action opens a dialog |
System.Boolean | useLegacyIcon | Whether or not this action should use legacy icon prefixed with "icon-" or full icon name is specified. |
Returns
Type | Description |
---|---|
MenuItem |
Type Parameters
Name | Description |
---|---|
T |