Interface IModelLayoutHostTools
Handles the opening of items, and other layout / display functions
Namespace: LemonEdge.Client.UI.API.Layouts
Assembly: LemonEdge.Client.UI.API.dll
Syntax
public interface IModelLayoutHostTools
Methods
CanOpenToLayout(EntityDescriptor)
Returns true if there is a default (DefaultLayoutGenerator), or custom (ILayout), layout for displaying a collection or single item of the specified entity type
The collection grid is allowed instead of just a single item one, as the collection can be filtered by the system to just the single item, allowing the system to display a single item in the default grid or single view depending on what is available
Declaration
Task<bool> CanOpenToLayout(EntityDescriptor desc)
Parameters
Type | Name | Description |
---|---|---|
EntityDescriptor | desc | The type of entity to check if there is a default layout for a collection or single entity type |
Returns
Type | Description |
---|---|
Task<bool> | True if there is a default (DefaultLayoutGenerator), or custom (ILayout), layout for displaying a collection or single item of the specified entity type |
CreateModelLayoutDisplayerController<TConcrete>(IModelLayoutDisplayer)
Creates an instance of IModelLayoutDisplayerController.
Declaration
IModelLayoutDisplayerController CreateModelLayoutDisplayerController<TConcrete>(IModelLayoutDisplayer displayer) where TConcrete : IModelLayoutDisplayerController
Parameters
Type | Name | Description |
---|---|---|
IModelLayoutDisplayer | displayer | The displayer that this controller controls |
Returns
Type | Description |
---|---|
IModelLayoutDisplayerController |
Type Parameters
Name | Description |
---|---|
TConcrete |
CreateModelLayoutDisplayer<TConcrete>(IModelLayoutCommon)
Creates an instance of IModelLayoutDisplayer.
Declaration
IModelLayoutDisplayer CreateModelLayoutDisplayer<TConcrete>(IModelLayoutCommon parent) where TConcrete : IModelLayoutDisplayer
Parameters
Type | Name | Description |
---|---|---|
IModelLayoutCommon | parent | The IModelLayoutCommon displayer |
Returns
Type | Description |
---|---|
IModelLayoutDisplayer |
Type Parameters
Name | Description |
---|---|
TConcrete |
CreateModelLayoutDisplayer<TConcrete>(IModelLayoutCommon, IModelView?)
Creates an instance of IModelLayoutDisplayer.
Declaration
IModelLayoutDisplayer CreateModelLayoutDisplayer<TConcrete>(IModelLayoutCommon parent, IModelView? parentView) where TConcrete : IModelLayoutDisplayer
Parameters
Type | Name | Description |
---|---|---|
IModelLayoutCommon | parent | The IModelLayoutCommon displayer |
IModelView | parentView | An optional parent<see cref="IModelView"/> |
Returns
Type | Description |
---|---|
IModelLayoutDisplayer |
Type Parameters
Name | Description |
---|---|
TConcrete |
CreateModelLayoutHostController<TConcrete>(IModelLayoutHost)
Creates an instance of IModelLayoutHostController.
Declaration
IModelLayoutHostController CreateModelLayoutHostController<TConcrete>(IModelLayoutHost view) where TConcrete : IModelLayoutHostController
Parameters
Type | Name | Description |
---|---|---|
IModelLayoutHost | view | The IModelLayoutHost view |
Returns
Type | Description |
---|---|
IModelLayoutHostController |
Type Parameters
Name | Description |
---|---|
TConcrete |
CreateModelSingleLayoutDisplayer()
Creates an instance of IModelSingleLayoutDisplayer.
Declaration
IModelSingleLayoutDisplayer CreateModelSingleLayoutDisplayer()
Returns
Type | Description |
---|---|
IModelSingleLayoutDisplayer |
IsOpen(IModelLayoutCommon, IBaseEntity)
Returns whether a layout is actually open for a given entity.
Declaration
bool IsOpen(IModelLayoutCommon host, IBaseEntity item)
Parameters
Type | Name | Description |
---|---|---|
IModelLayoutCommon | host | The layout / host |
IBaseEntity | item | The entity |
Returns
Type | Description |
---|---|
bool |
OpenItem(IModelLayoutCommon, IBaseEntity, IEntityUpdaterUI?)
Opens the specified item as a new layout in the provided host
.
If no con
is provided and changes have occurred in this context, then the item will be opened in the same context sharing it, otherwise it will be opened in a new context
itemSource
will need to be reloaded into the new context being used, otherwise it is assumed to already be a part of the existing context
Declaration
Task OpenItem(IModelLayoutCommon host, IBaseEntity itemSource, IEntityUpdaterUI? con = null)
Parameters
Type | Name | Description |
---|---|---|
IModelLayoutCommon | host | The host that this is being opened from, and that the new layout should be added to |
IBaseEntity | itemSource | The instance of the item to open. If the item is opened in a new context then this item will need to be reloaded into the new context being used, otherwise it is assumed to already be a part of the existing context |
IEntityUpdaterUI | con | An optional context that the item should be opened within. If null the item may still be opened in the existing context if it has pending changes, otherwise a new context will be created for the opened layout |
Returns
Type | Description |
---|---|
Task | A task indicating the completion of the operation |
OpenItem(IModelLayoutCommon, IBaseEntity, IEntityUpdaterUI?, Guid?)
Opens the specified item as a new layout in the provided host
with an optional custom ILayout override
If no con
is provided and changes have occurred in this context, then the item will be opened in the same context sharing it, otherwise it will be opened in a new context
itemSource
will need to be reloaded into the new context being used, otherwise it is assumed to already be a part of the existing context
Declaration
Task OpenItem(IModelLayoutCommon host, IBaseEntity itemSource, IEntityUpdaterUI? con, Guid? customLayoutOverrideID)
Parameters
Type | Name | Description |
---|---|---|
IModelLayoutCommon | host | The host that this is being opened from, and that the new layout should be added to |
IBaseEntity | itemSource | The instance of the item to open. If the item is opened in a new context then this item will need to be reloaded into the new context being used, otherwise it is assumed to already be a part of the existing context |
IEntityUpdaterUI | con | An optional context that the item should be opened within. If null the item may still be opened in the existing context if it has pending changes, otherwise a new context will be created for the opened layout |
Guid? | customLayoutOverrideID | The unique global id of an ILayout that holds a custom layout to use instead of the default one |
Returns
Type | Description |
---|---|
Task | A task indicating the completion of the operation |
OpenItem(IModelLayoutCommon, Type, Guid, IEntityUpdaterUI?)
Opens the specified item as a new layout in the provided host
If no con
is provided and changes have occurred in this context, then the item will be opened in the same context sharing it, otherwise it will be opened in a new context
Declaration
Task OpenItem(IModelLayoutCommon host, Type type, Guid id, IEntityUpdaterUI? con = null)
Parameters
Type | Name | Description |
---|---|---|
IModelLayoutCommon | host | The host that this is being opened from, and that the new layout should be added to |
Type | type | The type of the entity to open (either the interface or class type) |
Guid | id | The unique id of the entity to open |
IEntityUpdaterUI | con | An optional context that the item should be opened within. If null the item may still be opened in the existing context if it has pending changes, otherwise a new context will be created for the opened layout |
Returns
Type | Description |
---|---|
Task | A task indicating the completion of the operation |
OpenRelatedItem(IModelLayoutCommon, object?, string)
Opens the related item from the specified idBinding
property on the itemSource
as a new layout in the provided host
If changes have occurred in this context, then the item will be opened in the same context sharing it, otherwise it will be opened in a new context
Declaration
Task OpenRelatedItem(IModelLayoutCommon host, object? itemSource, string idBinding)
Parameters
Type | Name | Description |
---|---|---|
IModelLayoutCommon | host | The host of the current item that this is being opened from, and that the new layout should be added to |
object | itemSource | The item containing the id (on the |
string | idBinding | The name of the property on the |
Returns
Type | Description |
---|---|
Task | A task indicating the completion of the operation |
OpenRelatedItem(IModelLayoutCommon, object, string, EntityDescriptor, IEntityUpdaterUI?)
Opens the related item from the specified idBinding
property on the itemSource
as a new layout in the provided host
If no con
is provided and changes have occurred in this context, then the item will be opened in the same context sharing it, otherwise it will be opened in a new context
Declaration
Task OpenRelatedItem(IModelLayoutCommon host, object itemSource, string idBinding, EntityDescriptor toOpenType, IEntityUpdaterUI? con = null)
Parameters
Type | Name | Description |
---|---|---|
IModelLayoutCommon | host | The host of the current item that this is being opened from, and that the new layout should be added to |
object | itemSource | The item containing the id (on the |
string | idBinding | The name of the property on the |
EntityDescriptor | toOpenType | The type of item that should be opened with the id value from the |
IEntityUpdaterUI | con | An optional context that the item should be opened within. If null the item may still be opened in the existing context if it has pending changes, otherwise a new context will be created for the opened layout |
Returns
Type | Description |
---|---|
Task | A task indicating the completion of the operation |