Class ControlDisplayInfo
A complete control definition of the type of control that should be dynamically created in the client application UI via the IBaseGrid<T>, IBaseDefaultSingleView<T>, and IParamSingleViewer<T> views
Implements
Inherited Members
Namespace: LemonEdge.Client.Core.Views.Core
Assembly: ClientCore.dll
Syntax
public class ControlDisplayInfo : ControlDisplayVisibilityInfo, IEquatable<ControlDisplayInfo>
Constructors
ControlDisplayInfo(Int16, ColumnDescriptor, Boolean, Nullable<Double>)
Creates a new control display info to define the control that should be created in the client application ui with the specified properties
Declaration
public ControlDisplayInfo(short index, ColumnDescriptor colDesc, bool editable, double? width)
Parameters
Type | Name | Description |
---|---|---|
System.Int16 | index | The order this control should appear in the ui view it is created in |
ColumnDescriptor | colDesc | The definition of the property on the object this control is displaying and interacting with |
System.Boolean | editable | Indicates if the control is editable by the user |
System.Nullable<System.Double> | width | The width to display this control at in compliant client UIs. A null value defaults to the standard default width for that control type |
ControlDisplayInfo(Int16, Type, String, String, String, Nullable<Double>)
Creates a new control display info that is not bound to a property against the object, and instead evaluates a formula dynamically at runtime and displays the resulting value
This is only compatabile with the IBaseDefaultSingleView<T>, not the grid, or any other view just now.
Declaration
public ControlDisplayInfo(short index, Type propertyType, string formulaValue, string userFriendlyName, string description = null, double? width = default(double? ))
Parameters
Type | Name | Description |
---|---|---|
System.Int16 | index | The order this control should appear in the ui view it is created in |
System.Type | propertyType | The type of the value returned from the formula |
System.String | formulaValue | The formula to be evaluated at runtime |
System.String | userFriendlyName | A user friendly label for the control |
System.String | description | An optional description for the cotnrol |
System.Nullable<System.Double> | width |
Fields
DEFAULT_CONTROL_SIZE_INFINITE
The default control width for a control that should use all available width on the screen
Declaration
public const double DEFAULT_CONTROL_SIZE_INFINITE = 0
Field Value
Type | Description |
---|---|
System.Double |
DEFAULT_CONTROL_WIDTH_LARGE
The default control width for a control that requires a large amount of screen space
Declaration
public const double DEFAULT_CONTROL_WIDTH_LARGE = 400
Field Value
Type | Description |
---|---|
System.Double |
DEFAULT_CONTROL_WIDTH_NORMAL
The default control width for any normal control
Declaration
public const double DEFAULT_CONTROL_WIDTH_NORMAL = 175
Field Value
Type | Description |
---|---|
System.Double |
DEFAULT_CONTROL_WIDTH_NUMBERONLY
The default control width for a control that should be displaying a number only
Declaration
public const double DEFAULT_CONTROL_WIDTH_NUMBERONLY = 115
Field Value
Type | Description |
---|---|
System.Double |
DEFAULT_CONTROL_WIDTH_SMALL
The default control width for a control that should have a small amount of space.
Declaration
public const double DEFAULT_CONTROL_WIDTH_SMALL = 100
Field Value
Type | Description |
---|---|
System.Double |
Relationship
If this control is bound to a property of type Guid, then this can hold the relationship definition of the id the property holds
This results in the control created in the ui being capable of selecting and searching for the specified entites according to the relationship definition
The system will automatically apply this to entities that have properties marked with an EntityRelationshipDeclaration
public EntityRelationship Relationship
Field Value
Type | Description |
---|---|
EntityRelationship |
Properties
AggregateFunction
In the case this control is within a IBaseGrid<T> this can hold any aggregate function that should be applied to the results within the grid itself
Declaration
public AggregateFunction AggregateFunction { get; set; }
Property Value
Type | Description |
---|---|
AggregateFunction |
AllowFiltering
In the case this control is within a IBaseGrid<T> this indicates if the user should be allowed to filter the results of the grid by the values in this column
Declaration
public bool AllowFiltering { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
AllowSorting
In the case this control is within a IBaseGrid<T> this indicates if the user should be allowed to sort the results of the grid by the values in this column
Declaration
public bool AllowSorting { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
CanBeSearchedWithText
Returns true if this control is a text property or a relationship property
Declaration
public bool CanBeSearchedWithText { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
ChangeHighlighterPropertyName
Holds the name of a property (must be of type bool) the control should be bound to that highlights the value with a background colour if true, and leaves it as normal otherwise.
Used primarily in IBaseGrid<T> views to highlight cells within a column depending on their value
Declaration
public string ChangeHighlighterPropertyName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
CustomComboItems
If the created control should just be a combo box of selectable items, then this holds the key/value items that will be displayed to the user to select from
Declaration
public IEnumerable<KeyValuePair<string, string>> CustomComboItems { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, System.String>> |
CustomDynamicComboItemsBinding
In the case this control is within a IBaseGrid<T> this provides the name of a property on the item type that returns an array of System.Collections.Generic.KeyValuePair`2 of string, string.
This is called on each item in the grid to get a custom drop down list that depends on other values
Declaration
public string CustomDynamicComboItemsBinding { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Editable
Indicates if this control should be editable by the user or not
Declaration
public bool Editable { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Format
Any custom formatting to apply to the displayed value on this control
The CustomDateTimeFormat can be used for the correct date time formats to use, otherwise standard .net culture formatting applies
Declaration
public string Format { get; set; }
Property Value
Type | Description |
---|---|
System.String |
FormulaValue
Indicates this is a readonly control that should evaluate this formula dynamically at display the result
This is only compatabile with the IBaseDefaultSingleView<T>, not the grid, or any other view just now.
Declaration
public string FormulaValue { get; }
Property Value
Type | Description |
---|---|
System.String |
GetFilter
If this control has a defined Relationship then this filter is used by the control whenever the user selects an item for this control
The popup selection is filtered by this function so the user can only select certain entities rather than all entities in the entire system of the specified Relationship type
Declaration
public RelatedItemQueryFilter GetFilter { get; set; }
Property Value
Type | Description |
---|---|
RelatedItemQueryFilter |
Height
The height to display this control at in compliant client UIs.
Null means use the standard height appropriate for this control.
0 means infiniteDeclaration
public double? Height { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Double> |
Index
The order this control should appear in the ui view it is created in
Declaration
public short Index { get; }
Property Value
Type | Description |
---|---|
System.Int16 |
MultiLine
Indicates if this control deals with text that it should allow multiple lines to be entered (accept the return key) or not
Declaration
public bool MultiLine { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
NameForSearchText
Returns the property to use for a text search.
Would normally be the property this control is bound to, but can be a label property if this is searching a relationship instead
Declaration
public string NameForSearchText { get; }
Property Value
Type | Description |
---|---|
System.String |
StringMultiSelectComboItemsSeparator
If the field is a string property it can be set to store multiple selections from the CustomComboItems by setting a separator value here.
The user will then be able to select multiple items at once, and all of them will be stored against the property as a list separated by this string for each item
Declaration
public string StringMultiSelectComboItemsSeparator { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Width
The width to display this control at in compliant client UIs.
Null means use the standard width appropriate for this control.
0 means infiniteDeclaration
public double? Width { get; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Double> |
Methods
Create(EntityDescriptor, Boolean, Boolean)
Creates a set of control definitions for all the exportable properties against the specified entity type
Declaration
public static Task<IEnumerable<ControlDisplayInfo>> Create(EntityDescriptor desc, bool editable, bool allVisible = true)
Parameters
Type | Name | Description |
---|---|---|
EntityDescriptor | desc | The entity type to automatically return all the default controls for |
System.Boolean | editable | Indicates if the controls should be editable by the user or not |
System.Boolean | allVisible | Indicates system properties should be visible as well |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<ControlDisplayInfo>> | The set of controls for every exportable property against the specified entity |
Create(Int16, EntityDescriptor, ColumnDescriptor, Boolean, Boolean)
Creates a new control display info to define the control that should be created in the client application ui with the specified properties
Declaration
public static ControlDisplayInfo Create(short index, EntityDescriptor desc, ColumnDescriptor colInfo, bool editable, bool visible = true)
Parameters
Type | Name | Description |
---|---|---|
System.Int16 | index | The order this control should appear in the ui view it is created in |
EntityDescriptor | desc | An entity descriptor of the type of entity this control works against. Can be null if not an entity type |
ColumnDescriptor | colInfo | The definition of the property on the entity (or none entity object) this control is displaying and interacting with |
System.Boolean | editable | Indicates if the control is editable by the user |
System.Boolean | visible | Indicates if the control is initially visible to the user |
Returns
Type | Description |
---|---|
ControlDisplayInfo | The newly created control display info |
Equals(ControlDisplayInfo)
Declaration
public bool Equals(ControlDisplayInfo other)
Parameters
Type | Name | Description |
---|---|---|
ControlDisplayInfo | other |
Returns
Type | Description |
---|---|
System.Boolean |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |