Class BaseDefaultSingleViewExtenderController<DISPLAYTYPE, EXTENDEDTYPE>
The core controller for providing a IBaseDefaultSingleView<T> against an entity that extends (IsTypeExtender) another type
If the DISPLAYTYPE
does not exist this will temporarily create one and only add it to pending changes when the user actually modifies the temporary item itself
Inheritance
Implements
Inherited Members
Namespace: LemonEdge.Client.Core.Views.Core
Assembly: ClientCore.dll
Syntax
public abstract class BaseDefaultSingleViewExtenderController<DISPLAYTYPE, EXTENDEDTYPE> : BaseDefaultSingleViewController<DISPLAYTYPE>, IModelViewController where DISPLAYTYPE : IBaseEntity where EXTENDEDTYPE : IBaseEntity
Type Parameters
Name | Description |
---|---|
DISPLAYTYPE | The type that extends the
This type must have a relationship to the |
EXTENDEDTYPE | The type that |
Constructors
BaseDefaultSingleViewExtenderController(IBaseDefaultSingleView<DISPLAYTYPE>)
Creates a new default single view extender controller with the specified instance of a default single view
Declaration
public BaseDefaultSingleViewExtenderController(IBaseDefaultSingleView<DISPLAYTYPE> view)
Parameters
Type | Name | Description |
---|---|---|
IBaseDefaultSingleView<DISPLAYTYPE> | view | The instance of the default single view in the client application |
Properties
ExtendRelationshipExtendedTypeColumn
The property on the EXTENDEDTYPE
type that is the target of the IsTypeExtender relationship from the DISPLAYTYPE
type
Declaration
protected virtual string ExtendRelationshipExtendedTypeColumn { get; }
Property Value
Type | Description |
---|---|
System.String |
ExtendRelationshipSourceDisplayTypeColumn
The property on the DISPLAYTYPE
type that has a IsTypeExtender relationship linking to the EXTENDEDTYPE
type
Declaration
protected abstract string ExtendRelationshipSourceDisplayTypeColumn { get; }
Property Value
Type | Description |
---|---|
System.String |
TrackItemChanges
We always track items as we have to see if a temporary DISPLAYTYPE
entity created has been changed an needs to be inserted into the context for changes
Declaration
public override bool TrackItemChanges { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
Methods
Clear()
Removes any cached internal items
Declaration
public override Task Clear()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task indicating the completion of the operation |
Overrides
LoadSingleItem()
Loads the DISPLAYTYPE
to be displayed against this EXTENDEDTYPE
instance from the IsTypeExtender relationship between the two
If the item does not exist then a dummy one is created and cached, it is added to changes for this context only when the user actually makes a change to the dummy extending item instance (probably from this IBaseDefaultSingleView<T> view)
Declaration
public override Task<DISPLAYTYPE> LoadSingleItem()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DISPLAYTYPE> | The extending item to be displayed in this IBaseDefaultSingleView<T> view |
Overrides
OnTrackedItemChanged(Object, String)
If the DISPLAYTYPE
has changed and we just temporarily created it as a new item as it did not exist yet, then we need to add it to the context as a pending change
If the temporary DISPLAYTYPE
is never changed then we do not want to save it as the user has not made any changes that warrant the extending type to exist if it did not before
Declaration
protected override void OnTrackedItemChanged(object item, string propName)
Parameters
Type | Name | Description |
---|---|---|
System.Object | item | The item that changed |
System.String | propName | The property that changed |