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 ( LemonEdge.Client.Core.Views.Core.DisplayableItemDescriptorForCollection<T>), single entity item displays ( LemonEdge.Client.Core.Views.Core.DisplayableItemDescriptorSingle<T>), tool window displays ( LemonEdge.Client.Core.Views.Core.DisplayableItemDescriptorForToolWindow), and custom displays ( LemonEdge.Client.Core.Views.Core.DisplayableItemDescriptorForCustomSettings)Inheritance
Implements
Inherited Members
Namespace: LemonEdge.Client.UI.API.Layouts
Assembly: LemonEdge.Client.UI.API.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 LemonEdge.Client.Core.Views.Core.DisplayableItemDescriptorForCollection<T> sometimes uses the LemonEdge.Client.Core.Views.Core.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 |
Properties
Context
The IEntityUpdater context that is to be used by this descriptor and all views 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 DefaultLayoutGenerator.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 LemonEdge.Client.Core.Views.Core.DisplayableItemDescriptorSingle<T> returns the ItemName, and the LemonEdge.Client.Core.Views.Core.DisplayableItemDescriptorForCollection<T> returns the SetNameDeclaration
public abstract string UniqueLayoutDisplayName { get; }
Property Value
Type | Description |
---|---|
string |
Methods
ClearItem()
Declaration
public abstract void ClearItem()
Clone(IEntityUpdaterUI)
Returns a new IEntityUpdaterUI with the same CanvasID and GetUseAsOfDate settings
Declaration
public static Task<IEntityUpdaterUI> Clone(IEntityUpdaterUI original)
Parameters
Type | Name | Description |
---|---|---|
IEntityUpdaterUI | original | The original to copy the canvas and asofdate settings from |
Returns
Type | Description |
---|---|
Task<IEntityUpdaterUI> | A new IEntityUpdaterUI with the same CanvasID and GetUseAsOfDate settings |
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
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 LemonEdge.Client.Core.Views.Core.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 |