Interface IRootController
The model controller is the client application controller used by all LemonEdge clients. This is responsible for creating the main application along with new windows, popups, messages, etc.
If you are creating your own application you can utilise the LemonEdge controllers by calling CreateWindow<T>(IWindow?, bool) with an IRootModelViewer implementation.
This is required as LemonEdge has multiple different clients running on windows, console, and web versions, they all implement the ui interfaces and connect through this model controller so lemonedge can just work with different ui platformsNamespace: LemonEdge.Client.UI.API.Controllers
Assembly: LemonEdge.Client.UI.API.dll
Syntax
public interface IRootController
Properties
AutoUpdaterChecker
TODO: REMOVE- this is called in every command execute. Feels like this is wrong? should really be called somewhere else Returns the session IAutoUpdaterChecker.
Declaration
IAutoUpdaterChecker AutoUpdaterChecker { get; }
Property Value
Type | Description |
---|---|
IAutoUpdaterChecker |
CacheManager
TODO: REMOVE? Returns the session ICacheManager.
Declaration
ICacheManager CacheManager { get; }
Property Value
Type | Description |
---|---|
ICacheManager |
PauseWaiterActions
Only used by single thread application models, such as a command console
Indicates that while the system is processing a task it should update the ui with a periodic indicator that it is processing.
When this is false (default) it will not update the ui. For instance for the console application it will add a [.] every second it is still processing when this is true, and not for any other tasksDeclaration
bool PauseWaiterActions { get; set; }
Property Value
Type | Description |
---|---|
bool |
ServiceContext
The service / core context.
Declaration
IServiceContext ServiceContext { get; }
Property Value
Type | Description |
---|---|
IServiceContext |
UIContext
The context for UI tooling.
Declaration
IUIContext UIContext { get; }
Property Value
Type | Description |
---|---|
IUIContext |
Viewer
The ModelViewer this ModelController is using that is implemented by the client application to provide the specific UI components required by LemonEdge
Declaration
IRootModelViewer Viewer { get; }
Property Value
Type | Description |
---|---|
IRootModelViewer |
Methods
CreateMainForm(ISplashScreen, bool)
Creates the main form application from the client ui, then checks the version of the application and service match, along with the license being valid, and then loads the local cache all while updating the splash screen to show the progress
Declaration
Task<IMainForm> CreateMainForm(ISplashScreen splashScreen, bool forceCacheLoadFromServer)
Parameters
Type | Name | Description |
---|---|---|
ISplashScreen | splashScreen | The current splashscreen being showed while the main application loads |
bool | forceCacheLoadFromServer | If false indicates the local cache should be loaded, if one doesn't exist or this is false then it will always load the cache from the system and ignore any local copy |
Returns
Type | Description |
---|---|
Task<IMainForm> | The mainform created in the client application when the startup and cache have finished loading |
CreateWindow<T>(IWindow?, bool)
Creates the specified type of window in the client application ui that implements the specified interface
Declaration
T CreateWindow<T>(IWindow? owner, bool show = false) where T : IWindow
Parameters
Type | Name | Description |
---|---|---|
IWindow | owner | An optional parent window for the created window |
bool | show | Whether to show |
Returns
Type | Description |
---|---|
T | The created window in the client application ui |
Type Parameters
Name | Description |
---|---|
T | The interface the window to be created by the client application must implement |
CreateWindow<TWindow, TController>(IWindow?, bool)
Creates the specified window with controller in the client application ui
Declaration
WindowAndController<TWindow, TController> CreateWindow<TWindow, TController>(IWindow? owner = null, bool show = false) where TWindow : IWindow where TController : class
Parameters
Type | Name | Description |
---|---|---|
IWindow | owner | |
bool | show |
Returns
Type | Description |
---|---|
WindowAndController<TWindow, TController> |
Type Parameters
Name | Description |
---|---|
TWindow | |
TController |
DisplayAnyParamSingle(IModelLayoutCommon, SerializedParam)
Declaration
Task<(bool WindowExistsInUI, bool OkClicked, SerializedParam Result)> DisplayAnyParamSingle(IModelLayoutCommon host, SerializedParam param)
Parameters
Type | Name | Description |
---|---|---|
IModelLayoutCommon | host | |
SerializedParam | param |
Returns
Type | Description |
---|---|
Task<(bool WindowExistsInUI, bool OkClicked, SerializedParam Result)> |
DisplayMessage(IWindow?, MessageType, Exception)
Displays the specified exception message to the user in the client application ui
Declaration
Task<MessageResult> DisplayMessage(IWindow? owner, MessageType type, Exception ex)
Parameters
Type | Name | Description |
---|---|---|
IWindow | owner | The owning window that originates the message, ensuring this message is a child of it |
MessageType | type | The type of message to display |
Exception | ex | The exception to display the details of to the user |
Returns
Type | Description |
---|---|
Task<MessageResult> | A task returning how the user dismissed the message box |
DisplayMessage(IWindow?, MessageType, string, string, ImageType)
Displays the specified message to the user in the client application ui
Declaration
Task<MessageResult> DisplayMessage(IWindow? owner, MessageType type, string title, string message, ImageType img)
Parameters
Type | Name | Description |
---|---|---|
IWindow | owner | The owning window that originates this message |
MessageType | type | The type of message to display |
string | title | The title for the message |
string | message | The message itself to display to the user |
ImageType | img | The image to use with the message |
Returns
Type | Description |
---|---|
Task<MessageResult> | A task returning how the user dismissed the message box |
DisplayParamSingle<TResult>(IModelLayoutCommon, TResult)
Declaration
Task<(bool WindowExistsInUI, bool OkClicked, TResult Result)> DisplayParamSingle<TResult>(IModelLayoutCommon host, TResult param) where TResult : SerializedParam
Parameters
Type | Name | Description |
---|---|---|
IModelLayoutCommon | host | |
TResult | param |
Returns
Type | Description |
---|---|
Task<(bool WindowExistsInUI, bool OkClicked, TResult Result)> |
Type Parameters
Name | Description |
---|---|
TResult |
DisplayParam<TResult>(IModelLayoutCommon, TResult)
Declaration
Task<(bool WindowExistsInUI, bool OkClicked, TResult Result)> DisplayParam<TResult>(IModelLayoutCommon host, TResult param) where TResult : SerializedParam
Parameters
Type | Name | Description |
---|---|---|
IModelLayoutCommon | host | |
TResult | param |
Returns
Type | Description |
---|---|
Task<(bool WindowExistsInUI, bool OkClicked, TResult Result)> |
Type Parameters
Name | Description |
---|---|
TResult |
DisplayPopup<T, TResult>(IWindow, Func<T, Task>, Func<T, IPopupWindowController<TResult>>)
Declaration
Task<(bool WindowExistsInUI, bool OkClicked, TResult Result)> DisplayPopup<T, TResult>(IWindow owner, Func<T, Task> initWindow, Func<T, IPopupWindowController<TResult>> createController) where T : IPopupWindow<TResult>
Parameters
Type | Name | Description |
---|---|---|
IWindow | owner | |
Func<T, Task> | initWindow | |
Func<T, IPopupWindowController<TResult>> | createController |
Returns
Type | Description |
---|---|
Task<(bool WindowExistsInUI, bool OkClicked, TResult Result)> |
Type Parameters
Name | Description |
---|---|
T | |
TResult |
OnUnhandledException(object, UnhandledExceptionEventArgs)
The handler for an unhandled exception.
Declaration
void OnUnhandledException(object sender, UnhandledExceptionEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
object | sender | |
UnhandledExceptionEventArgs | e |
ProcessException(Exception)
A handler for exception processing.
Declaration
Task ProcessException(Exception exception)
Parameters
Type | Name | Description |
---|---|---|
Exception | exception |
Returns
Type | Description |
---|---|
Task |
Reload()
Reloads the application's discoverable UI components.
Declaration
Task Reload()
Returns
Type | Description |
---|---|
Task |
Shutdown()
Forces a shutdown of the entire client application
Declaration
void Shutdown()