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.
Inherited Members
Namespace: LemonEdge.Client.Core.Main
Assembly: LemonEdge.ClientCore.dll
Syntax
public class MainFormController : ModelLayoutHostController, IHaveAddInListeners, IMainFormController, IModelLayoutHostController, IController
Constructors
MainFormController(IMainForm, IRootController, IOptions<UpdaterSettings>, IDomainContextEventHandler)
Declaration
public MainFormController(IMainForm window, IRootController rootController, IOptions<UpdaterSettings> updaterSettings, IDomainContextEventHandler contextEventHandler)
Parameters
| Type | Name | Description |
|---|---|---|
| IMainForm | window | |
| IRootController | rootController | |
| IOptions<UpdaterSettings> | updaterSettings | |
| IDomainContextEventHandler | contextEventHandler |
Properties
MenuWithoutDuplicatedOnAllMenuItems
Returns a list of all main menu items and their associated Command object that can be used in the client ui application
Declaration
public IEnumerable<MenuItemCommand> MenuWithoutDuplicatedOnAllMenuItems { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<MenuItemCommand> |
Methods
ActivateOnLoadItems(IEnumerable<MenuItemCommand>)
Declaration
public void ActivateOnLoadItems(IEnumerable<MenuItemCommand> allMenuItems)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<MenuItemCommand> | allMenuItems |
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(bool)
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 |
|---|---|---|
| bool | 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 |
|---|---|
| Task<bool> | A task indicating if the close was successful. 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<MenuItemCommand>> CreateDuplicateActivateOnAllMenusCommands()
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<MenuItemCommand>> | A list of each main menu item and a new actual Command object if the item is marked as ActiveOnAllMenus |
Menu(bool)
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 IEnumerable<MenuItemCommand> Menu(bool duplicateActivateOnAllMenuItems)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | duplicateActivateOnAllMenuItems | Indicates that for each item marked as ActiveOnAllMenus the returned list should contain it copied into each main menu |
Returns
| Type | Description |
|---|---|
| IEnumerable<MenuItemCommand> | A list of all main menu items and their associated Command object that can be used in the client ui application |