Class CodeSnippetResultsController
Inheritance
Implements
Inherited Members
Namespace: LemonEdge.Client.Core.Views.Controllers
Assembly: LemonEdge.ClientEntities.dll
Syntax
public class CodeSnippetResultsController : BaseGridControllerAny<object>, IBaseGridController, ICollectionExportable, INewGridItemImplementor<object>, ICopyGridItemImplementor<object>, IGrid, IDeleteGridItemImplementor<object>, ISearchController, IModelViewController
Constructors
CodeSnippetResultsController(IBaseGrid<object>)
Declaration
public CodeSnippetResultsController(IBaseGrid<object> view)
Parameters
| Type | Name | Description |
|---|---|---|
| IBaseGrid<object> | view |
Properties
AddStandardColumns
The system adds standard columns to every grid that are initially hidden, but can be viewed by the user. These columns are returned from GetStandardExtraColumns(string)
These are columns common to every entity in the system: LastUpdated, ModifiedByUserID, CanvasID, and Status, CancelledID, CorrectedByID (if object is of type ITransactionalEntity) ID
The default is these columns are added if object is an entity type deriving from IBaseEntityDeclaration
protected override bool AddStandardColumns { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Overrides
AllowCopyCommand
Indicates the command to allow selected rows to be copied by the user is included in the InitCommands(IList<ViewCommand>)
The default is false
Declaration
public override bool AllowCopyCommand { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Overrides
AllowExcelExport
Indicates the command to allow the grid data to be exported by the user is included in the InitCommands(IList<ViewCommand>)
The default is true
Declaration
public override bool AllowExcelExport { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Overrides
AllowNewCommand
Indicates the command to allow new items to be created by the user is included in the InitCommands(IList<ViewCommand>)
The default is false if NewItemHelper is equal to null
Declaration
public override bool AllowNewCommand { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Overrides
AllowOpenCommand
Indicates the command to allow selected rows to be opened by the user is included in the InitCommands(IList<ViewCommand>)
The default is false
Declaration
public override bool AllowOpenCommand { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Overrides
AllowSearchCommand
Indicates the command to allow the default search of text by the user is included in the InitCommands(IList<ViewCommand>)
The default is true
Declaration
public override bool AllowSearchCommand { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Overrides
AutoOpenNewItemInTab
Indicates when creating a new item in the grid that it should automatically be opened in a new tab as well
The default is true if the type object is an entity that is not a IsStandingDataEntity
Declaration
public override bool AutoOpenNewItemInTab { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Overrides
CheckIsLockedForCanWrite
Indicates the controller should check if the item is locked before allowing CanWrite to be true. Defaults to true.
Declaration
protected override bool CheckIsLockedForCanWrite { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Overrides
CollectionType
Indicates the collection type is of type object
Declaration
public override Type CollectionType { get; }
Property Value
| Type | Description |
|---|---|
| Type |
Overrides
DefaultRowCount
The default number of rows that should be displayed in the grid before the grid will start paging the results
The default number is DisplayableItemDescriptor.UIRestrictedMaxCollectionItems which can be set depending on the client application. For instance mobiles can override this to a smaller number
The default if DisplayableItemDescriptor.UIRestrictedMaxCollectionItems is not set is 500Declaration
public override int DefaultRowCount { get; }
Property Value
| Type | Description |
|---|---|
| int |
Overrides
DefaultSearchColumn
The name of the column to use in the default search of text in the grid
Declaration
protected override string DefaultSearchColumn { get; }
Property Value
| Type | Description |
|---|---|
| string |
Overrides
Methods
AlterColumnInfo(ControlDisplayInfo)
Provides an inheriting controller the opportunity to alter the specified column before it is added to the IBaseGrid<T>
This is used in conjunction with columns defined via ColumnNames(), rather than Columns() which explicitly defines all information
The default operation provides a CustomComboItems if the column is against a property that is a link to an entity type (IsEntityLink)Declaration
protected override void AlterColumnInfo(ControlDisplayInfo info)
Parameters
| Type | Name | Description |
|---|---|---|
| ControlDisplayInfo | info | The definition of the column that can be updated before being created in the IBaseGrid<T> |
Overrides
ColumnNames()
A list of all the columns to be dynamically created in the IBaseGrid<T>
This is used by the system to create the actual ControlDisplayInfo classes required from the Columns() property
You can override this to provide a simple definition of each column (combined with AlterControlInfo(ControlDisplayInfo) for more detail), or you can just override Columns() and ignore thisDeclaration
protected override IEnumerable<ControlDisplayInfoLight> ColumnNames()
Returns
| Type | Description |
|---|---|
| IEnumerable<ControlDisplayInfoLight> | A list of all the columns to be dynamically created in the IBaseGrid<T> |
Overrides
DisplayItem(object)
Clears the view, determines if CanWrite is true, and if it ShouldDisplayItem(object?) then calls AddHandlers(object) and DisplayUI()
Declaration
public override Task DisplayItem(object item)
Parameters
| Type | Name | Description |
|---|---|---|
| object | item | The item to be displayed against this View |
Returns
| Type | Description |
|---|---|
| Task | A task indicating the completion of the operation |
Overrides
GetGridSourceItems()
A function that must be implemented by inheriting classes that returns the list of items to be displayed against the grid given all active filters, sorting, searches, paging, etc
Declaration
public override Task<IEnumerable<object>> GetGridSourceItems()
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<object>> | A list of items to be displayed against the grid given all active filters, sorting, searches, paging, etc |
Overrides
GetOpenGridCommand()
Returns the command for opening the grid item.
Not implemented for this controller as the object may not be an entity type it knows how to open. Must be implemented by an inheriting controller.
Declaration
protected override ViewCommand GetOpenGridCommand()
Returns
| Type | Description |
|---|---|
| ViewCommand | The command for opening the grid item. |
Overrides
InitAsync()
Provides the controller a chance to initialize any dependant data. Called once by the system after controller creation.
Declaration
public override Task InitAsync()
Returns
| Type | Description |
|---|---|
| Task | A task indicating the completion of the operation |
Overrides
OnOpenRowItem(object)
A method called by the system to open the specified data item from the grid
The defult implementation throws an error, this must be implemented by an inheriting controller if the AllowOpenCommand is true
Declaration
public override Task OnOpenRowItem(object rowItem)
Parameters
| Type | Name | Description |
|---|---|---|
| object | rowItem | The item to open by the system |
Returns
| Type | Description |
|---|---|
| Task | A task indicating the completion of the operation |