Class DisplayableItemDescriptor
This is the main class that is always passed to a IModelLayoutDisplayerController to be displayed by that layout displayer
This wraps the item to be displayed with other properties such as if its read-only, the context ( IEntityUpdater), label/icon info, etc
Inheriting display descriptors all serve different purposes, allowing behaviour such as collection displays ( DisplayableItemDescriptorForCollection<T>), single entity item displays ( DisplayableItemDescriptorSingle<T>), tool window displays ( DisplayableItemDescriptorForToolWindow), and custom displays ( DisplayableItemDescriptorForCustomSettings)Inheritance
Implements
Inherited Members
Namespace: LemonEdge.Client.Core.Views.Core
Assembly: LemonEdge.ClientCore.dll
Syntax
public abstract class DisplayableItemDescriptor : IEquatable<DisplayableItemDescriptor>
Constructors
DisplayableItemDescriptor(IEntityUpdater)
Creates a new displayable item descriptor with the specified context
Declaration
protected DisplayableItemDescriptor(IEntityUpdater context)
Parameters
| Type | Name | Description |
|---|---|---|
| IEntityUpdater | context | The context all operations within this descriptor (and thus IModelLayoutDisplayerController that displays this) use |
Fields
ItemParams
Any custom parameters associated with this Item
For instance the DisplayableItemDescriptorForCollection<T> sometimes uses the DisplayableItemDescriptorForCollectionParams to filter the collection results shown to only specific items instead of the entire collection of entities
Declaration
public object ItemParams
Field Value
| Type | Description |
|---|---|
| object |
UIRestrictedMaxCollectionItems
Declaration
public static int? UIRestrictedMaxCollectionItems
Field Value
| Type | Description |
|---|---|
| int? |
Properties
Context
The IEntityUpdater context that is to be used by this descriptor and all veiws in the IModelLayoutDisplayer for displaying and interacting with this Item
Declaration
public IEntityUpdaterUI Context { get; protected set; }
Property Value
| Type | Description |
|---|---|
| IEntityUpdaterUI |
CustomLayoutOverride
Provides a custom layout generator to use to load the display for the IModelLayoutDisplayer instead of the default one found from GenerateLayout(string, string)
Declaration
public ILayoutGenerator CustomLayoutOverride { get; set; }
Property Value
| Type | Description |
|---|---|
| ILayoutGenerator |
CustomLayoutOverrideID
Provides the id of a ILayout that should be used to load the display for the IModelLayoutDisplayer instead of the default one found from GenerateLayout(string, string)
Declaration
public Guid? CustomLayoutOverrideID { get; set; }
Property Value
| Type | Description |
|---|---|
| Guid? |
HelpURL
Returns a help url for the individual Item being displayed by this descriptor
Declaration
public virtual string HelpURL { get; }
Property Value
| Type | Description |
|---|---|
| string |
ImageID
Returns the image to be used in the header by the IModelLayoutDisplayer for displaying this Item
This image and GetLabel() can be used for an easy method of identifying the IModelLayoutDisplayer among the many that maybe open within the IModelLayoutHost
Declaration
public abstract Guid ImageID { get; }
Property Value
| Type | Description |
|---|---|
| Guid |
Item
The actual item to be displayed by the IModelLayoutDisplayer
Declaration
public abstract object Item { get; }
Property Value
| Type | Description |
|---|---|
| object |
LabelBinding
The name of a property on the Item object that holds the label the user can refer to this item with, and should be visible to the user as the heading for the IModelLayoutDisplayer that displays this item
Declaration
public abstract string LabelBinding { get; }
Property Value
| Type | Description |
|---|---|
| string |
LayoutDisplayParam
The layout parameter to be used to load the display for this Item in the IModelLayoutDisplayer
This is used by the CanGenerateDefaultLayout(string, string) as the layoutParam check
Declaration
public virtual string LayoutDisplayParam { get; }
Property Value
| Type | Description |
|---|---|
| string |
OverlayImageID
An optional image to be overlaid on the ImageID to create a single merged image
Declaration
public virtual Guid? OverlayImageID { get; }
Property Value
| Type | Description |
|---|---|
| Guid? |
ParentLayout
An optional IModelLayoutDisplayer that is the parent of this one
This is used when a IModelLayoutDisplayer opens a new item in a separate IModelLayoutDisplayer. The opened one would be marked as having the original as a parent
This allows the system to keep track of the fact parent layouts should be refreshed if child ones are saved so displays accurately update. For instance if you change an item the parent grid with that item should update when it is saved too.Declaration
public IModelLayoutDisplayerController ParentLayout { get; set; }
Property Value
| Type | Description |
|---|---|
| IModelLayoutDisplayerController |
ReadOnly
Indicates if this Item is to be opened in a read-only IModelLayoutDisplayer for the user
Declaration
public bool ReadOnly { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
UniqueLayoutDisplayName
The key name for the layout that should be used to load the display for this Item in the IModelLayoutDisplayer
This is used by the CanGenerateDefaultLayout(string, string) as the uniqueLayoutName check
The DisplayableItemDescriptorSingle<T> returns the ItemName, and the DisplayableItemDescriptorForCollection<T> returns the SetNameDeclaration
public abstract string UniqueLayoutDisplayName { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
ClearCache()
Clears the local cache of layouts so they are reloaded on next call
Declaration
public static void ClearCache()
ClearItem()
Declaration
public abstract void ClearItem()
CreateCollectionDefault(IEntityUpdater, Type)
Creates a DisplayableItemDescriptorForCollection<T> for the specified entity
forType
Declaration
public static DisplayableItemDescriptor CreateCollectionDefault(IEntityUpdater context, Type forType)
Parameters
| Type | Name | Description |
|---|---|---|
| IEntityUpdater | context | The context this collection should be loaded in, and that the IModelLayoutDisplayer should operate within |
| Type | forType | The type of entity this collection displayable item should display |
Returns
| Type | Description |
|---|---|
| DisplayableItemDescriptor | A DisplayableItemDescriptorForCollection<T> for the specified entity
|
CreateCustomSettingsDefault(IEntityUpdater, CustomSettingsItem)
Creates a DisplayableItemDescriptorForCustomSettings for the specified custom setting type
item
Declaration
public static DisplayableItemDescriptor CreateCustomSettingsDefault(IEntityUpdater context, CustomSettingsItem item)
Parameters
| Type | Name | Description |
|---|---|---|
| IEntityUpdater | context | The context this custom setting and the IModelLayoutDisplayer should operate within |
| CustomSettingsItem | item | The type of custom setting to be loaded |
Returns
| Type | Description |
|---|---|
| DisplayableItemDescriptor | A DisplayableItemDescriptorForCustomSettings for the specified custom setting type
|
CreateForCollectionAny<T>(IEntityUpdater, string)
Declaration
public static DisplayableItemDescriptor CreateForCollectionAny<T>(IEntityUpdater context, string labelProperty) where T : class
Parameters
| Type | Name | Description |
|---|---|---|
| IEntityUpdater | context | |
| string | labelProperty |
Returns
| Type | Description |
|---|---|
| DisplayableItemDescriptor |
Type Parameters
| Name | Description |
|---|---|
| T |
CreateSingleDefault(IEntityUpdater, object)
Creates a DisplayableItemDescriptorSingle<T> for the specified entity item
Declaration
public static DisplayableItemDescriptor CreateSingleDefault(IEntityUpdater context, object item)
Parameters
| Type | Name | Description |
|---|---|---|
| IEntityUpdater | context | The context this |
| object | item | The single entity to be displayed in the IModelLayoutDisplayer |
Returns
| Type | Description |
|---|---|
| DisplayableItemDescriptor | A DisplayableItemDescriptorSingle<T> for the specified entity |
CreateToolWindowDefault(IEntityUpdater, ToolWindowItem)
Creates a DisplayableItemDescriptorForToolWindow for the specified tool window type
item
Declaration
public static DisplayableItemDescriptor CreateToolWindowDefault(IEntityUpdater context, ToolWindowItem item)
Parameters
| Type | Name | Description |
|---|---|---|
| IEntityUpdater | context | The context this tool window and the IModelLayoutDisplayer should operate within |
| ToolWindowItem | item | The type of tool window to be loaded |
Returns
| Type | Description |
|---|---|
| DisplayableItemDescriptor | A DisplayableItemDescriptorForToolWindow for the specified tool window type
|
Equals(DisplayableItemDescriptor)
Declaration
public virtual bool Equals(DisplayableItemDescriptor other)
Parameters
| Type | Name | Description |
|---|---|---|
| DisplayableItemDescriptor | other |
Returns
| Type | Description |
|---|---|
| bool |
Equals(object)
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj |
Returns
| Type | Description |
|---|---|
| bool |
Overrides
GetAllDisplayableLayouts()
Returns all the possible layouts that are used by all implementations of DisplayableItemDescriptor
This is determined by enumerating all IDisplayableDescriptorPossibleLayouts implementations
Declaration
public static Task<IEnumerable<(string LayoutName, string Param, Type DisplayableType, ILayoutGenerator DefaultGenerator)>> GetAllDisplayableLayouts()
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<(string LayoutName, string Param, Type DisplayableType, ILayoutGenerator DefaultGenerator)>> | All the possible layouts that are used by all implementations of DisplayableItemDescriptor |
GetDisplayableType(string, string)
Returns the type of the item that is displayed against the specified layout key combination
Declaration
public static Task<Type> GetDisplayableType(string layoutName, string layoutParam)
Parameters
| Type | Name | Description |
|---|---|---|
| string | layoutName | The unique name for the layout |
| string | layoutParam | Any optional parameters for the layout |
Returns
| Type | Description |
|---|---|
| Task<Type> | The type of the item that is displayed against the specified layout key combination |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int |
Overrides
GetLabel()
Returns the evaluated label for the Item to be used as the header for the IModelLayoutDisplayer that displays this item
If there is no LabelBinding this just uses the ToString implementation of the Item object
If the Context is running with an GetUseAsOfDate then the label is also appended with the as of date it is running withinDeclaration
public string GetLabel()
Returns
| Type | Description |
|---|---|
| string | The evaluated label for the Item to be used as the header for the IModelLayoutDisplayer that displays this item |
GetLabelWithChanges()
Returns the GetLabel() value prepended with an "*" if the Context has any pending changes within it
Declaration
public string GetLabelWithChanges()
Returns
| Type | Description |
|---|---|
| string | The GetLabel() value prepended with an "*" if the Context has any pending changes within it |
GetTooltip()
Returns a tool tip to be used for the IModelLayoutDisplayer that displays this Item
By default this just returns the GetLabel() but provides inheriting Display Descriptors the opportunity to override this
For instance the DisplayableItemDescriptorSingle<T> uses this to indicate who created the item, and when it was last modified, etcDeclaration
public virtual Task<string> GetTooltip()
Returns
| Type | Description |
|---|---|
| Task<string> | A tool tip to be used for the IModelLayoutDisplayer that displays this Item |
Recreate()
Returns a new DisplayableItemDescriptor that has the same setup as this one, but refreshes from a new Context and reloads the Item (if required)
Declaration
public abstract Task<DisplayableItemDescriptor> Recreate()
Returns
| Type | Description |
|---|---|
| Task<DisplayableItemDescriptor> | A new DisplayableItemDescriptor that has the same setup as this one, but refreshes from a new Context and reloads the Item (if required) |
RefreshItemParams()
Gives ItemParams an opportunity to refresh itself if needed, if ItemParams inherits IRecreateOnRefresh.
Declaration
protected Task RefreshItemParams()
Returns
| Type | Description |
|---|---|
| Task |
SetLayoutDisplayParam(string)
Declaration
public void SetLayoutDisplayParam(string param)
Parameters
| Type | Name | Description |
|---|---|---|
| string | param |
Operators
operator ==(DisplayableItemDescriptor, DisplayableItemDescriptor)
Declaration
public static bool operator ==(DisplayableItemDescriptor a, DisplayableItemDescriptor b)
Parameters
| Type | Name | Description |
|---|---|---|
| DisplayableItemDescriptor | a | |
| DisplayableItemDescriptor | b |
Returns
| Type | Description |
|---|---|
| bool |
operator !=(DisplayableItemDescriptor, DisplayableItemDescriptor)
Declaration
public static bool operator !=(DisplayableItemDescriptor a, DisplayableItemDescriptor b)
Parameters
| Type | Name | Description |
|---|---|---|
| DisplayableItemDescriptor | a | |
| DisplayableItemDescriptor | b |
Returns
| Type | Description |
|---|---|
| bool |