Search Results for

    Show / Hide Table of Contents

    Class DisplayableItemDescriptor

    This is the main class that is always passed to a ModelLayoutDisplayerController 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
    System.Object
    DisplayableItemDescriptor
    DisplayableItemDescriptorForCollection<T>
    DisplayableItemDescriptorForCustomSettings
    DisplayableItemDescriptorForToolWindow
    DisplayableItemDescriptorSingle<T>
    Implements
    System.IEquatable<DisplayableItemDescriptor>
    Inherited Members
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: LemonEdge.Client.Core.Views.Core
    Assembly: ClientCore.dll
    Syntax
    public abstract class DisplayableItemDescriptor : IEquatable<DisplayableItemDescriptor>

    Constructors

    DisplayableItemDescriptor(IEntityUpdaterUI)

    Creates a new displayable item descriptor with the specified context

    Declaration
    protected DisplayableItemDescriptor(IEntityUpdaterUI context)
    Parameters
    Type Name Description
    IEntityUpdaterUI context

    The context all operations within this descriptor (and thus ModelLayoutDisplayerController 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 entites

    Declaration
    public object ItemParams
    Field Value
    Type Description
    System.Object

    UIRestrictedMaxCollectionItems

    Declaration
    public static int? UIRestrictedMaxCollectionItems
    Field Value
    Type Description
    System.Nullable<System.Int32>

    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
    System.Nullable<System.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
    System.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 IModelLayouHost

    Declaration
    public abstract Guid ImageID { get; }
    Property Value
    Type Description
    System.Guid

    Item

    The actual item to be displayed by the IModelLayoutDisplayer

    Declaration
    public abstract object Item { get; }
    Property Value
    Type Description
    System.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
    System.String

    LayoutDisplayParam

    The layout parameter to be used to load the display for this Item in the IModelLayoutDisplayer

    This is used by the LemonEdge.Client.Core.Views.DefaultLayouts.DefaultLayoutGenerator.CanGenerateDefaultLayout(System.String,System.String) as the layoutParam check

    Declaration
    public virtual string LayoutDisplayParam { get; }
    Property Value
    Type Description
    System.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
    System.Nullable<System.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 ModelLayoutDisplayerController ParentLayout { get; set; }
    Property Value
    Type Description
    ModelLayoutDisplayerController

    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
    System.Boolean

    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 LemonEdge.Client.Core.Views.DefaultLayouts.DefaultLayoutGenerator.CanGenerateDefaultLayout(System.String,System.String) as the uniqueLayoutName check

    The DisplayableItemDescriptorSingle<T> returns the ItemName, and the DisplayableItemDescriptorForCollection<T> returns the SetName
    Declaration
    public abstract string UniqueLayoutDisplayName { get; }
    Property Value
    Type Description
    System.String

    Methods

    ClearCache()

    Clears the local cache of layouts so they are reloaded on next call

    Declaration
    public static void ClearCache()

    CreateCollectionDefault(IEntityUpdaterUI, Type)

    Creates a DisplayableItemDescriptorForCollection<T> for the specified entity forType

    Declaration
    public static DisplayableItemDescriptor CreateCollectionDefault(IEntityUpdaterUI context, Type forType)
    Parameters
    Type Name Description
    IEntityUpdaterUI context

    The context this collection should be loaded in, and that the IModelLayoutDisplayer should operate within

    System.Type forType

    The type of entity this collection displayable item should display

    Returns
    Type Description
    DisplayableItemDescriptor

    A DisplayableItemDescriptorForCollection<T> for the specified entity forType

    CreateCustomSettingsDefault(IEntityUpdaterUI, CustomSettingsItem)

    Creates a DisplayableItemDescriptorForCustomSettings for the specified custom setting type item

    Declaration
    public static DisplayableItemDescriptor CreateCustomSettingsDefault(IEntityUpdaterUI context, CustomSettingsItem item)
    Parameters
    Type Name Description
    IEntityUpdaterUI 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 item

    CreateSingleDefault(IEntityUpdaterUI, Object)

    Creates a DisplayableItemDescriptorSingle<T> for the specified entity item

    Declaration
    public static DisplayableItemDescriptor CreateSingleDefault(IEntityUpdaterUI context, object item)
    Parameters
    Type Name Description
    IEntityUpdaterUI context

    The context this item belongs to, and that the IModelLayoutDisplayer should operate within

    System.Object item

    The single entity to be displayed in the IModelLayoutDisplayer

    Returns
    Type Description
    DisplayableItemDescriptor

    A DisplayableItemDescriptorSingle<T> for the specified entity item

    CreateToolWindowDefault(IEntityUpdaterUI, ToolWindowItem)

    Creates a DisplayableItemDescriptorForToolWindow for the specified tool window type item

    Declaration
    public static DisplayableItemDescriptor CreateToolWindowDefault(IEntityUpdaterUI context, ToolWindowItem item)
    Parameters
    Type Name Description
    IEntityUpdaterUI 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 item

    Equals(DisplayableItemDescriptor)

    Declaration
    public virtual bool Equals(DisplayableItemDescriptor other)
    Parameters
    Type Name Description
    DisplayableItemDescriptor other
    Returns
    Type Description
    System.Boolean

    Equals(Object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    System.Object obj
    Returns
    Type Description
    System.Boolean
    Overrides
    System.Object.Equals(System.Object)

    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)>> GetAllDisplayableLayouts()
    Returns
    Type Description
    System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<System.ValueTuple<System.String, System.String, System.Type>>>

    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
    System.String layoutName

    The unique name for the layout

    System.String layoutParam

    Any optional parameters for the layout

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Type>

    The type of the item that is displayed against the specified layout key combination

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32
    Overrides
    System.Object.GetHashCode()

    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 within
    Declaration
    public string GetLabel()
    Returns
    Type Description
    System.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
    System.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, etc
    Declaration
    public virtual Task<string> GetTooltip()
    Returns
    Type Description
    System.Threading.Tasks.Task<System.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
    System.Threading.Tasks.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)

    Operators

    Equality(DisplayableItemDescriptor, DisplayableItemDescriptor)

    Declaration
    public static bool operator ==(DisplayableItemDescriptor a, DisplayableItemDescriptor b)
    Parameters
    Type Name Description
    DisplayableItemDescriptor a
    DisplayableItemDescriptor b
    Returns
    Type Description
    System.Boolean

    Inequality(DisplayableItemDescriptor, DisplayableItemDescriptor)

    Declaration
    public static bool operator !=(DisplayableItemDescriptor a, DisplayableItemDescriptor b)
    Parameters
    Type Name Description
    DisplayableItemDescriptor a
    DisplayableItemDescriptor b
    Returns
    Type Description
    System.Boolean

    Implements

    System.IEquatable<T>

    Extension Methods

    MiscExtensions.SetIfNotEqual<T, P>(T, Expression<Func<T, P>>, P)
    ReflectionExtensions.ClearEventInvocations(Object, String)
    StringExtensions.ToCSVFormatString(Object, Type)
    SQLExtensions.ToSQLValue(Object, Boolean)
    In This Article
    Back to top © LemonTree Software Ltd. All rights reserved.