Class MainFormController
The controller for the main IMainform window of the LemonEdge application. Responsible for loading the main menu commands, and hosting the multiple opened contexts.
Implements
Inherited Members
Namespace: LemonEdge.Client.Core.Main
Assembly: ClientCore.dll
Syntax
public class MainFormController : ModelLayoutHostController, IController
Properties
MenuWithoutDuplicatedOnAllMenuItems
Returns a list of all main menu items and their associated Command object that can be used in the client ui application
If duplicateActivateOnAllMenuItems
is true then it is still only returned once, this method does not copy it for each menu. Use Menu(Boolean) for that.
Declaration
public IEnumerable<(IMenuItem MenuItem, EPCommand Command)> MenuWithoutDuplicatedOnAllMenuItems { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.ValueTuple<IMenuItem, EPCommand>> |
Methods
Clear()
Clears the main user interface for the main application window by disposing of all the main menu commands
Declaration
public override void Clear()
Overrides
Close(Boolean)
Closes the main application. If there are any open contexts with unsaved changes then promptSaveChanges
indicates if the user should be prompted to save them before closing
Declaration
public Task<bool> Close(bool promptSaveChanges = false)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | promptSaveChanges | Indicates if there are any unsaved changes the user is given the option to save them first before closing, or to cancel the close. If false the system will close loosing any unsaved changes. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Boolean> | A task indicating if the close was succesful. False if there were changes and the user decided to cancel closing the application. |
CreateDuplicateActivateOnAllMenusCommands()
Returns a list of each main menu item and a new actual Command object if the item is marked as ActiveOnAllMenus
Declaration
public Task<IEnumerable<(IMenuItem MenuItem, EPCommand Command)>> CreateDuplicateActivateOnAllMenusCommands()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<System.ValueTuple<IMenuItem, EPCommand>>> | A list of each main menu item and a new actual Command object if the item is marked as ActiveOnAllMenus |
Menu(Boolean)
Returns a list of all main menu items and their associated Command object that can be used in the client ui application
If duplicateActivateOnAllMenuItems
is true then each item marked as ActiveOnAllMenus is copied for each main menu with a new associated Command object too.
Declaration
public Task<IEnumerable<(IMenuItem MenuItem, EPCommand Command)>> Menu(bool duplicateActivateOnAllMenuItems)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | duplicateActivateOnAllMenuItems | Indicates that for each item marked as ActiveOnAllMenus the returned list should contain it copied into each main menu |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<System.ValueTuple<IMenuItem, EPCommand>>> | A list of all main menu items and their associated Command object that can be used in the client ui application |