Interface IDefaultMenuItemCreator
The helper implementation of a class for updating the standard menu commands
Namespace: LemonEdge.API.Core.Migrations
Assembly: LemonEdge.API.Core.Migrations.dll
Syntax
public interface IDefaultMenuItemCreator
Properties
AdminRoleID
The globally unique id of the standard admin role
Declaration
Guid AdminRoleID { get; }
Property Value
Type | Description |
---|---|
Guid |
Cache
A local cache
Declaration
IReadOnlyCache Cache { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCache |
StandardRoleID
The globally unique id of the standard user role
Declaration
Guid StandardRoleID { get; }
Property Value
Type | Description |
---|---|
Guid |
Methods
CreateMenuItem(Guid, short, string, bool, short, string, short, ICommandDescriptor, bool, bool, bool, bool, bool, bool)
Creates the specified menu item
Declaration
Task CreateMenuItem(Guid roleID, short tabIndex, string tabName, bool activeOnAllMenus, short groupIndex, string groupName, short itemIndex, ICommandDescriptor defaultDescription, bool activateOnLoad, bool addToMenuBar, bool addToUserMenuBar, bool addToQuickAccess, bool visible, bool addToSimplified)
Parameters
Type | Name | Description |
---|---|---|
Guid | roleID | The role this menu command belongs to |
short | tabIndex | The index of the tab this command will belong to |
string | tabName | The name of the the tab this command will belong to |
bool | activeOnAllMenus | Indicates this command should appear on all menus created for this role. This is often used to provide consistent access to common commands such as Save from everywhere. |
short | groupIndex | The index of the group within the tab that this command will belong to |
string | groupName | The name of the group within the tab that this command will belong to |
short | itemIndex | The index of the command within the group that this command will belong to |
ICommandDescriptor | defaultDescription | A user friendly description of the function of this item command |
bool | activateOnLoad | Indicates this command should be activated when the menus are first loaded in the client as a default activation |
bool | addToMenuBar | This indicates the command should also appear in the menu bar at the top right near the user menu. If you also mark this command as invisible then it will only appear in the menu bar, and not on the main menu itself. |
bool | addToUserMenuBar | This indicates the command should also appear in the user menu at the top right. If you also mark this command as invisible then it will only appear in the user menu, and not on the main menu itself. |
bool | addToQuickAccess | This indicates the command should also appear in the quick access at the top left of the app. If you also mark this command as invisible then it will only appear in the quick access, and not on the main menu itself. |
bool | visible | Indicates if this command should be visible on the main menu. This is usually used to hide the command from the main menu and make it visible in the user menu, or quick access, only. |
bool | addToSimplified | By default the menu shows all commands. However if you start selecting commands as being part of a simplified set, then by default the menu will show the simplified set only. When you toggle the simplified menu you can then see all the other commands as well. |
Returns
Type | Description |
---|---|
Task |
EnsureImageExists(string, Guid, byte[])
Ensures the specified custom image exists in the system
Declaration
Task EnsureImageExists(string imageName, Guid imageID, byte[] imageResource)
Parameters
Type | Name | Description |
---|---|---|
string | imageName | The Name of the custom image |
Guid | imageID | The unique ImageID for this custom image |
byte[] | imageResource | The raw image |
Returns
Type | Description |
---|---|
Task | A task indicating the completion of the operation |
EnsureImageExists(string, Guid, string, Assembly)
Ensures the specified custom image exists in the system
Declaration
Task EnsureImageExists(string imageName, Guid imageID, string imageResourceName, Assembly resourceAssembly)
Parameters
Type | Name | Description |
---|---|---|
string | imageName | The Name of the custom image |
Guid | imageID | The unique ImageID for this custom image |
string | imageResourceName | The name of the image resource embedded in the assembly |
Assembly | resourceAssembly | The assembly containing the image resource |
Returns
Type | Description |
---|---|
Task | A task indicating the completion of the operation |
GetCurrentMenu(Guid)
Returns all the current menu items for the specified role
Declaration
IEnumerable<IMenuItem> GetCurrentMenu(Guid roleID)
Parameters
Type | Name | Description |
---|---|---|
Guid | roleID | The role to return all current menu items for |
Returns
Type | Description |
---|---|
IEnumerable<IMenuItem> | All the current menu items for the specified role |
RemoveMenuItem(IMenuItem)
Remove the specified menu item (typically retrieved from GetCurrentMenu(Guid)) from the system
Declaration
Task RemoveMenuItem(IMenuItem menuItem)
Parameters
Type | Name | Description |
---|---|---|
IMenuItem | menuItem | The menu item to be removed from the system |
Returns
Type | Description |
---|---|
Task | A task indicating the completion of the operation |