Search Results for

    Show / Hide Table of Contents

    Class EPCommand

    The base command for all commands in the LemonEdge platform, implementing the IEPCommand interface

    Commands inheriting this can be displayed on the main menu and anywhere throughout the application. View specific commands should typically inherit from ViewCommand

    Inheritance
    object
    BaseHasChildren<EPCommandWithDescriptor>
    EPCommand
    About
    AddToFavourites
    Close
    CloseOtherTabs
    AnyCollectionCommand
    AnyItemCommand
    CustomCommand
    EPCommandWithDescriptor
    EntityCollectionCommand<T>
    GroupedItemsCommand
    NewItemCommand
    OpenItemCommand
    Dashboard
    DataSourceSearch
    DatabaseSchema
    ExportTemplate
    GenerateCode
    Quit
    RefreshAll
    RefreshContext
    RefreshServers
    RemoveFromFavourites
    Settings
    SwitchUser
    Implements
    IHasChildren<EPCommandWithDescriptor>
    IHasChildren
    IEPCommand
    ICommand
    IDisposable
    Inherited Members
    BaseHasChildren<EPCommandWithDescriptor>.AddChild(EPCommandWithDescriptor, bool)
    BaseHasChildren<EPCommandWithDescriptor>.DeleteChild(EPCommandWithDescriptor)
    BaseHasChildren<EPCommandWithDescriptor>.ClearChildren()
    BaseHasChildren<EPCommandWithDescriptor>.ClearMyParent()
    BaseHasChildren<EPCommandWithDescriptor>.AddChild(IHasChildren)
    BaseHasChildren<EPCommandWithDescriptor>.DeleteChild(IHasChildren)
    BaseHasChildren<EPCommandWithDescriptor>.Order
    BaseHasChildren<EPCommandWithDescriptor>.Children
    BaseHasChildren<EPCommandWithDescriptor>.Parent
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: LemonEdge.Client.Core.Commands.Core
    Assembly: LemonEdge.ClientCore.dll
    Syntax
    public abstract class EPCommand : BaseHasChildren<EPCommandWithDescriptor>, IHasChildren<EPCommandWithDescriptor>, IHasChildren, IEPCommand, ICommand, IDisposable

    Constructors

    EPCommand(IModelLayoutCommon, EPCommandWithDescriptor)

    Creates a new EPCommand

    Declaration
    protected EPCommand(IModelLayoutCommon owner, EPCommandWithDescriptor parent = null)
    Parameters
    Type Name Description
    IModelLayoutCommon owner

    The owning context this command operates within

    EPCommandWithDescriptor parent

    An optional parent command if this command is a child command

    Properties

    ActiveDisplayerFromOwner

    Returns the active layout this command is working against depending on the owner type.

    Returns the owner itself if it is of type IModelLayoutDisplayer, else returns the active layout if it is of type IModelLayoutHost

    Declaration
    protected IModelLayoutDisplayer ActiveDisplayerFromOwner { get; }
    Property Value
    Type Description
    IModelLayoutDisplayer

    CustomType

    The custom type of command if this command needs special handling in the client UI that can not be performed generically from the core UI

    Declaration
    public EPCommandCustomType CustomType { get; }
    Property Value
    Type Description
    EPCommandCustomType

    From

    Declaration
    public ICommandDescriptor From { get; set; }
    Property Value
    Type Description
    ICommandDescriptor

    HasChildCommands

    Indicates this command has child commands that should be loaded by the LemonEdge system using LoadChildrenAsync()

    The default is false

    Declaration
    public virtual bool HasChildCommands { get; }
    Property Value
    Type Description
    bool

    IsQuickAccessCommand

    Indicates this command should also be available in a quick access manner if the ui permits it to be highlighted and seperated for quick access among a group of other commands

    For instance in the desktop application view commands are accessible from a drop down menu by default, but if this is true they are also directly accessible from the view itself

    Declaration
    public virtual bool IsQuickAccessCommand { get; }
    Property Value
    Type Description
    bool

    Key

    Indicates the command key to use for executing this from a keyboard command

    Declaration
    public virtual KeyboardKey Key { get; }
    Property Value
    Type Description
    KeyboardKey

    LockExecution

    An external lock that will disable execution of this command (via CanExecute(object) returning false) until it is set back to the default false.

    Declaration
    public bool LockExecution { get; set; }
    Property Value
    Type Description
    bool

    ModifierKeys

    Indicates the modifier keys to be used with Key when executing this command from the keyboard

    Declaration
    public virtual KeyboardModifierKeys ModifierKeys { get; }
    Property Value
    Type Description
    KeyboardModifierKeys

    Owner

    The owning context this command operates within

    Declaration
    public IModelLayoutCommon Owner { get; }
    Property Value
    Type Description
    IModelLayoutCommon

    ReloadChildrenOnEachOpen

    Indicates each time this command is "expanded" in the client application that it should reload the child commands in case they have changed

    The default is false, in that child commands are only loaded once and cached for the command itself

    Declaration
    public virtual bool ReloadChildrenOnEachOpen { get; }
    Property Value
    Type Description
    bool

    Seperator

    The static separator instance that has no command action

    Declaration
    public static ViewCommandSeperator Seperator { get; }
    Property Value
    Type Description
    ViewCommandSeperator

    SubscribeToLayoutChange

    Indicates this command should track changes to the layouts and reevaluate its Can Execute status.

    Used by commands such as Save which change their enabled status depending on the currently active layout

    Declaration
    public virtual bool SubscribeToLayoutChange { get; }
    Property Value
    Type Description
    bool

    Toggler

    If this command can toggle between two states, then this toggler implementation provides a mechanism for the command to react to the toggled state changing

    Declaration
    public IHasToggleStatus Toggler { get; }
    Property Value
    Type Description
    IHasToggleStatus

    Methods

    Dispose()

    Declaration
    public void Dispose()

    Dispose(bool)

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    bool disposing

    ExternalCanExecute(object)

    Returns if this command can be executed from the client application UI.

    You must override InternalCanExecute(object) or InternalCanExecuteAsync(object) in order to implement if it can be executed

    The system also checks if it is currently executing or if it is locked, to return false as well
    Declaration
    public Task<bool> ExternalCanExecute(object parameter)
    Parameters
    Type Name Description
    object parameter

    The command parameter

    Returns
    Type Description
    Task<bool>

    True if this command can currently be executed from the client application UI.

    ExternalExecute(object)

    Executes the commands as an asynchronous operation. CanExecute(object) returns False until this call has completed

    Declaration
    public Task ExternalExecute(object parameter)
    Parameters
    Type Name Description
    object parameter

    The command parameter

    Returns
    Type Description
    Task

    A task indicating the completion of the command execution

    GetModifierText(IEPCommand)

    Returns the helper text indicating how to execute this command using modifier keys. For instance if Key = A, and ModifierKeys = Alt, this would return [Alt+A]

    Declaration
    public static string GetModifierText(IEPCommand command)
    Parameters
    Type Name Description
    IEPCommand command

    The commmand to return the modifier key binding text for

    Returns
    Type Description
    string

    Helper text indicating how to execute this command using modifier keys. For instance if Key = A, and ModifierKeys = Alt, this would return [Alt+A]

    InternalCanExecute(object)

    Returns if this command can be executed or not from the client application UI

    You must override InternalCanExecute(object) or InternalCanExecuteAsync(object) in order to implement if it can be executed

    Declaration
    public virtual bool InternalCanExecute(object parameter)
    Parameters
    Type Name Description
    object parameter

    The command parameter

    Returns
    Type Description
    bool

    If this command can be executed or not from the client application UI

    InternalCanExecuteAsync(object)

    Returns if this command can be executed or not from the client application UI

    You must override InternalCanExecute(object) or InternalCanExecuteAsync(object) in order to implement if it can be executed

    Declaration
    public virtual Task<bool> InternalCanExecuteAsync(object parameter)
    Parameters
    Type Name Description
    object parameter

    The command parameter

    Returns
    Type Description
    Task<bool>

    If this command can be executed or not from the client application UI

    InternalExecute(object)

    You must override InternalExecuteAsync(object) or InternalExecute(object) in order to implement your commands action

    Declaration
    public virtual void InternalExecute(object parameter)
    Parameters
    Type Name Description
    object parameter

    The command parameter

    InternalExecuteAsync(object)

    You must override InternalExecuteAsync(object) or InternalExecute(object) in order to implement your commands action

    Declaration
    public virtual Task InternalExecuteAsync(object parameter)
    Parameters
    Type Name Description
    object parameter

    The command parameter

    Returns
    Type Description
    Task

    LoadChildrenAsync()

    Provides an inheriting command the opportunity to load any child commands contained within it

    Declaration
    public virtual Task LoadChildrenAsync()
    Returns
    Type Description
    Task

    OnCanExecuteChanged()

    Provides a mechanism for the command to raise its CanExecuteChanged event

    Declaration
    public void OnCanExecuteChanged()

    OnLayoutsChanged(IModelLayoutHost, LayoutChangeEventArgs)

    If SubscribeToLayoutChange is true then this is called everytime the layout changes with the type of change

    Declaration
    protected virtual void OnLayoutsChanged(IModelLayoutHost sender, LayoutChangeEventArgs e)
    Parameters
    Type Name Description
    IModelLayoutHost sender

    The source host that is raising the change of layout

    LayoutChangeEventArgs e

    The way in which the main form layouts have changed

    RemoveEventHandlersOnDispose()

    Provides an inheriting command the opoortunity to remove any event handlers being listened to before this command is disposed

    Declaration
    protected virtual void RemoveEventHandlersOnDispose()

    SetToggler(IHasToggleStatus)

    Sets the toggler to use for this command if it should be represented as a toggle command

    Declaration
    protected void SetToggler(IHasToggleStatus toggler)
    Parameters
    Type Name Description
    IHasToggleStatus toggler

    The toggler to use for the Toggler of this command

    Events

    CanExecuteChanged

    The event indicating the commands can execute has changed

    Declaration
    public event EventHandler CanExecuteChanged
    Event Type
    Type Description
    EventHandler

    Implements

    IHasChildren<T>
    IHasChildren
    IEPCommand
    ICommand
    IDisposable

    Extension Methods

    CommandExtensions.CreateCommand(EPCommand, ICommandDescriptor, CommandButtonType, bool, CommandSize)
    CommandExtensions.UpdateCommand(EPCommand, object, ICommandDescriptor, bool, CommandSize)
    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.