Search Results for

    Show / Hide Table of Contents

    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: LemonEdge.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
    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
    Guid?

    Methods

    CanCreate(UserInfo, IReadOnlyCache, IEntityUpdater)

    Returns true if the user has permissions to create a new entity of type T

    Declaration
    Task<bool> CanCreate(UserInfo userInfo, IReadOnlyCache cache, IEntityUpdater updater)
    Parameters
    Type Name Description
    UserInfo userInfo

    The currently 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
    Task<bool>

    True if the user has permissions to create a new entity of type T

    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
    Task<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
    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

    Extension Methods

    LinqExtensions.AsArray<T>(T)
    LinqExtensions.ToArrayOfOne<T>(T)
    LinqExtensions.ToListOfOne<T>(T)
    MiscExtensions.SetIfNotEqual<T, TP>(T, Expression<Func<T, TP>>, TP)
    WeakReferenceExtensions.WeakReference(object)
    SQLExtensions.ToSQLValue(object, bool)
    ReflectionExtensions.ClearEventInvocations(object, string)
    StringExtensions.ToCSVFormatString(object, Type)
    In this article
    Back to top © LemonEdge Technologies. All rights reserved.