Class ModelLayoutHostController
The main controller for any IModelLayoutHost view which can contain multiple instances of IModelLayoutDisplayer
Inherited Members
Namespace: LemonEdge.Client.Core.Views.Core
Assembly: LemonEdge.ClientCore.dll
Syntax
public class ModelLayoutHostController : IModelLayoutHostController, IController, IHaveAddInListeners
Constructors
ModelLayoutHostController(IModelLayoutHost, IRootController, IDomainContextEventHandler)
Creates a new ModelLayoutHostController for the specified IModelLayoutHost
Declaration
public ModelLayoutHostController(IModelLayoutHost displayer, IRootController rootController, IDomainContextEventHandler contextEventHandler)
Parameters
| Type | Name | Description |
|---|---|---|
| IModelLayoutHost | displayer | The host client application ui that this controller uses for interacting with the application |
| IRootController | rootController | The root application ModelController, for service access |
| IDomainContextEventHandler | contextEventHandler | The event handler |
Properties
ActiveLayout
The currently active layout the user is interacting with in this Displayer
Declaration
public IModelLayoutDisplayer ActiveLayout { get; }
Property Value
| Type | Description |
|---|---|
| IModelLayoutDisplayer |
ActiveNonToolWindowLayout
The currently active layout that is a tool window that the user is interacting with in this Displayer
Declaration
public IModelLayoutDisplayer ActiveNonToolWindowLayout { get; }
Property Value
| Type | Description |
|---|---|
| IModelLayoutDisplayer |
Displayer
The ui in the client application that hosts multiple instances of a IModelLayoutDisplayer
Declaration
public IModelLayoutHost Displayer { get; }
Property Value
| Type | Description |
|---|---|
| IModelLayoutHost |
Layouts
All the current loaded layouts hosted within the Displayer
Declaration
public IEnumerable<IModelLayoutDisplayer> Layouts { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<IModelLayoutDisplayer> |
NonToolWindowLayouts
All the layouts hosted within the Displayer that are not tool windows (that operate on the active layout and are identified as having a MainDisplayedItem of type DisplayableItemDescriptorForToolWindow)
Declaration
public IEnumerable<IModelLayoutDisplayer> NonToolWindowLayouts { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<IModelLayoutDisplayer> |
OwningWindow
The owning window this Displayer is hosted within
Declaration
public IWindow OwningWindow { get; }
Property Value
| Type | Description |
|---|---|
| IWindow |
RootController
The root application controller
Declaration
public IRootController RootController { get; }
Property Value
| Type | Description |
|---|---|
| IRootController |
Methods
AddAddInListeners()
Adds listeners.
Declaration
public void AddAddInListeners()
Clear()
Provides any inheriting classes an opportunity to clear the Displayer. Typically disposes of any main menu commands
Declaration
public virtual void Clear()
CloseLayout(IModelLayoutDisplayer, bool)
Closes the specified layout, removes it from the Displayer, disposes of it and return true if the layout was removed
If silent is false, and the layout has pending changes within its context then this will first prompt the user to continue, save or cancel. If the user selects cancel or the save fails then false is returned.
Declaration
public Task<bool> CloseLayout(IModelLayoutDisplayer layout, bool silent = false)
Parameters
| Type | Name | Description |
|---|---|---|
| IModelLayoutDisplayer | layout | The layout to be closed, and removed from the Displayer |
| bool | silent | If true means any pending changes should be ignored and disposed. If false and the layout has pending changes then it will prompt the user what to do before closing the layout |
Returns
| Type | Description |
|---|---|
| Task<bool> | True if the layout was closed, or false if the user cancelled or a save failed |
GetDescriptorsWithLayouts()
Gets the list of descriptors
Declaration
public Task<IEnumerable<Guid>> GetDescriptorsWithLayouts()
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<Guid>> |
IsToolWindowLayout(IModelLayoutDisplayer)
Returns true if the specified layout is a tool window which operates on the active layout and has a MainDisplayedItem of type DisplayableItemDescriptorForToolWindow
Declaration
public bool IsToolWindowLayout(IModelLayoutDisplayer layout)
Parameters
| Type | Name | Description |
|---|---|---|
| IModelLayoutDisplayer | layout | The layout to identify if it is a tool window or not |
Returns
| Type | Description |
|---|---|
| bool | True if the specified layout is a tool window which operates on the active layout and has a MainDisplayedItem of type DisplayableItemDescriptorForToolWindow |
RemoveAddInListeners()
Removes listeners.
Declaration
public void RemoveAddInListeners()
ToString()
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string |