Class ModelLayoutHostTools
Implements
Inherited Members
Namespace: LemonEdge.Client.Core.Views.Core
Assembly: LemonEdge.ClientCore.dll
Syntax
public class ModelLayoutHostTools : IModelLayoutHostTools
Constructors
ModelLayoutHostTools(IEntityDescriptorFactory, ILayoutGeneratorFactory, IFactoryInjector, ILogger<ModelLayoutHostTools>)
Declaration
public ModelLayoutHostTools(IEntityDescriptorFactory entityDescriptorFactory, ILayoutGeneratorFactory layoutGeneratorFactory, IFactoryInjector factoryInjector, ILogger<ModelLayoutHostTools> logger)
Parameters
| Type | Name | Description |
|---|---|---|
| IEntityDescriptorFactory | entityDescriptorFactory | |
| ILayoutGeneratorFactory | layoutGeneratorFactory | |
| IFactoryInjector | factoryInjector | |
| ILogger<ModelLayoutHostTools> | logger |
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
public 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
public 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
public 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
public 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
public 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
public IModelSingleLayoutDisplayer CreateModelSingleLayoutDisplayer()
Returns
| Type | Description |
|---|---|
| IModelSingleLayoutDisplayer |
IsOpen(IModelLayoutCommon, IBaseEntity)
Returns whether a layout is actually open for a given entity.
Declaration
public 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
public 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
public 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
public 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
public 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
public 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 |