Interface INewItemHelper<T>
This interface is designed to help controllers using the NewGridItem<T> command to provide a mechanism for overriding the behaviour of creating new items in the grid
For instance this provides a mechanism that the IDocument grid controller uses to popup a file selection dialog box before creating new items linked to a file
Namespace: LemonEdge.Client.Core.Commands.ViewCommands
Assembly: ClientCore.dll
Syntax
public interface INewItemHelper<T>
Type Parameters
Name | Description |
---|---|
T | The type of new entity type to create |
Properties
ItemName
The singlular name of the item to be created.
Declaration
string ItemName { get; }
Property Value
Type | Description |
---|---|
System.String |
OverlayIconID
The default icon to overlay over the new image for the command to create a new entity of type T
Declaration
Guid? OverlayIconID { get; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Guid> |
Methods
CanCreate(UserInfo, IReadOnlyCache)
Returns true if the user has permissions to create a new entity of type T
Declaration
Task<bool> CanCreate(UserInfo userInfo, IReadOnlyCache cache)
Parameters
Type | Name | Description |
---|---|---|
UserInfo | userInfo | The currently logged in user |
IReadOnlyCache | cache | A local cache |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Boolean> | True if the user has permissions to create a new entity of type |
CreateNewItem(UserInfo, IReadOnlyCache, IEntityUpdater)
Creates a collection of new entities of type T
Declaration
Task<IEnumerable<T>> CreateNewItem(UserInfo userInfo, IReadOnlyCache cache, IEntityUpdater updater)
Parameters
Type | Name | Description |
---|---|---|
UserInfo | userInfo | The current logged in user |
IReadOnlyCache | cache | A local cache |
IEntityUpdater | updater | The context the items are being created in and can be added to |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<T>> | A list of the newly created items. |
GetOpenDescriptor(IEntityUpdaterUI, T)
Returns the descriptor used for displaying the new item in a new tab context in the application
Declaration
Task<DisplayableItemDescriptor> GetOpenDescriptor(IEntityUpdaterUI updater, T item)
Parameters
Type | Name | Description |
---|---|---|
IEntityUpdaterUI | updater | The current context the new item has been created within |
T | item | The new item itself that should be displayed in its own tab layout |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DisplayableItemDescriptor> | A descriptor used for displaying the new item in a new tab context in the application |
MarkForInsert(IEntityUpdaterUI, T)
For each new item created the system calls this to mark the item as a new pending change in the updater
context
Provides a mechanism to add other related new items into the context too that may have been created for each "Top Level;" entity
Declaration
void MarkForInsert(IEntityUpdaterUI updater, T item)
Parameters
Type | Name | Description |
---|---|---|
IEntityUpdaterUI | updater | The updater context the new items are being created in |
T | item | The newly created entity |