Interface IDefaultMenuItemCreator
The helper implementation of a class for updating the standard menu commands
Namespace: LemonEdge.Connections.Database.Migrations.Core
Assembly: API.dll
Syntax
public interface IDefaultMenuItemCreator
Properties
AdminRoleID
The globally unique id of the standard admin role
Declaration
Guid AdminRoleID { get; }
Property Value
Type | Description |
---|---|
System.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 |
---|---|
System.Guid |
Methods
CreateMenuItem(Guid, Int16, String, Boolean, Int16, String, Int16, ICommandDescriptor, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean)
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 |
---|---|---|
System.Guid | roleID | The role this menu command belongs to |
System.Int16 | tabIndex | The index of the tab this command will belong to |
System.String | tabName | The name of the the tab this command will belong to |
System.Boolean | 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. |
System.Int16 | groupIndex | The index of the group within the tab that this command will belong to |
System.String | groupName | The name of the group within the tab that this command will belong to |
System.Int16 | 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 |
System.Boolean | activateOnLoad | Indicates this command should be activated when the menus are first loaded in the client as a default activation |
System.Boolean | 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. |
System.Boolean | 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. |
System.Boolean | 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. |
System.Boolean | 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. |
System.Boolean | 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 |
---|---|
System.Threading.Tasks.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 |
---|---|---|
System.String | imageName | The Name of the custom image |
System.Guid | imageID | The unique ImageID for this custom image |
System.Byte[] | imageResource | The raw image |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task indicating the completion of the operation |
EnsureImageExists(String, Guid, String, Assembly)
Ensures the specified custom image exists in the system
Declaration
virtual Task EnsureImageExists(string imageName, Guid imageID, string imageResourceName, Assembly resourceAssembly)
Parameters
Type | Name | Description |
---|---|---|
System.String | imageName | The Name of the custom image |
System.Guid | imageID | The unique ImageID for this custom image |
System.String | imageResourceName | The name of the image resource embedded in the assembly |
System.Reflection.Assembly | resourceAssembly | The assembly containing the image resource |
Returns
Type | Description |
---|---|
System.Threading.Tasks.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 |
---|---|---|
System.Guid | roleID | The role to return all current menu items for |
Returns
Type | Description |
---|---|
System.Collections.Generic.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 |
---|---|
System.Threading.Tasks.Task | A task indicating the completion of the operation |