Search Results for

    Show / Hide Table of Contents

    Class TaskBase

    The base task command for executing any IServerTask in the system, providing a popup of parameters to the user, running it locally or remotely, and tracking the progress of the task to notify the user

    Inheritance
    object
    BaseHasChildren<EPCommandWithDescriptor>
    EPCommand
    EPCommandWithDescriptor
    ViewCommand
    TaskBase
    ApiScheduler
    ExportData
    ImportData
    ObfuscateFieldsTask
    ResetSystemRoles
    SQLWrapperDatasetUsage
    TruncateTable
    VerifyConfig
    FinaliseTransactionsViewCommand
    RevertTransactionBase<T>
    RunReport
    AddInModulesController.UpgradeServer
    ImportDefinitionController.RunImport
    QueryRunnersController.Run
    ReconciliationController.RunReconcileTask
    ResetSQLFunctions
    Implements
    IHasChildren<EPCommandWithDescriptor>
    IHasChildren
    IDisposable
    IEPCommandWithDescriptor
    IEPCommand
    ICommand
    ICommandDescriptor
    Inherited Members
    ViewCommand.Type
    EPCommandWithDescriptor.OverlayIconID
    EPCommandWithDescriptor.Parameter
    EPCommandWithDescriptor.HelpURL
    EPCommand.OnCanExecuteChanged()
    EPCommand.LoadChildrenAsync()
    EPCommand.SetToggler(IHasToggleStatus)
    EPCommand.OnLayoutsChanged(IModelLayoutHost, LayoutChangeEventArgs)
    EPCommand.ExternalExecute(object)
    EPCommand.InternalExecute(object)
    EPCommand.ExternalCanExecute(object)
    EPCommand.InternalCanExecute(object)
    EPCommand.InternalCanExecuteAsync(object)
    EPCommand.GetModifierText(IEPCommand)
    EPCommand.RemoveEventHandlersOnDispose()
    EPCommand.Dispose(bool)
    EPCommand.Dispose()
    EPCommand.RootController
    EPCommand.ActiveDisplayerFromOwner
    EPCommand.ReloadChildrenOnEachOpen
    EPCommand.HasChildCommands
    EPCommand.SubscribeToLayoutChange
    EPCommand.From
    EPCommand.LockExecution
    EPCommand.CustomType
    EPCommand.Owner
    EPCommand.Toggler
    EPCommand.CanExecuteChanged
    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.ViewCommands
    Assembly: LemonEdge.ClientCore.dll
    Syntax
    public abstract class TaskBase : ViewCommand, IHasChildren<EPCommandWithDescriptor>, IHasChildren, IDisposable, IEPCommandWithDescriptor, IEPCommand, ICommand, ICommandDescriptor

    Constructors

    TaskBase(bool, IRootController, IModelLayoutCommon, Guid)

    Creates a new TaskBase command

    Declaration
    protected TaskBase(bool runOnServer, IRootController root, IModelLayoutCommon owner, Guid taskType)
    Parameters
    Type Name Description
    bool runOnServer

    Indicates if the command should run on the server by default or not. If the task can be run locally then this behaviour can be overridden by the user when executing the command by holding down ctrl (indicated through IRootController.Viewer.IsKeyModifierPressed)

    IRootController root

    The root controller, for service access.

    IModelLayoutCommon owner

    The owner context this command is executed from within

    Guid taskType

    The globally unique id of the task type this command should execute

    Properties

    Description

    A user friendly description of this command

    Declaration
    public override string Description { get; }
    Property Value
    Type Description
    string
    Overrides
    EPCommandWithDescriptor.Description

    IconID

    The image to use for this command, either a ImageType or ImageID

    Declaration
    public override Guid IconID { get; }
    Property Value
    Type Description
    Guid
    Overrides
    EPCommandWithDescriptor.IconID

    IncludeInSimple

    By default view commands are included in any simple layout filtering of commands if they are part of the quick access

    Declaration
    public override bool IncludeInSimple { get; }
    Property Value
    Type Description
    bool
    Overrides
    ViewCommand.IncludeInSimple

    InternalExecuteWithChanges

    Indicates if the command can execute with changes against the context the command is in.

    Default implementation returns true if this command runs locally, has a modifier key pressed to run locally, or has no pending changes against the context

    Declaration
    protected virtual bool InternalExecuteWithChanges { 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 override bool IsQuickAccessCommand { get; }
    Property Value
    Type Description
    bool
    Overrides
    EPCommand.IsQuickAccessCommand

    Key

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

    Declaration
    public override KeyboardKey Key { get; }
    Property Value
    Type Description
    KeyboardKey
    Overrides
    EPCommand.Key

    ModifierKeys

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

    Declaration
    public override KeyboardModifierKeys ModifierKeys { get; }
    Property Value
    Type Description
    KeyboardModifierKeys
    Overrides
    EPCommand.ModifierKeys

    RunOnServer

    Declaration
    public bool RunOnServer { get; }
    Property Value
    Type Description
    bool

    TaskParamType

    The actual type of ServerTaskParameter class that holds the parameters for this server task implementation

    Declaration
    protected Type TaskParamType { get; }
    Property Value
    Type Description
    Type

    TaskType

    The attribute describing the parameters for this task, which also holds the globally unique id of the task type

    Declaration
    protected ServerTaskParametersAttribute TaskType { get; }
    Property Value
    Type Description
    ServerTaskParametersAttribute

    Title

    The title of this command

    Declaration
    public override string Title { get; }
    Property Value
    Type Description
    string
    Overrides
    EPCommandWithDescriptor.Title

    ToolTip

    A user friendly tool tip for this command functionality, by default the Description

    Declaration
    public override string ToolTip { get; }
    Property Value
    Type Description
    string
    Overrides
    EPCommandWithDescriptor.ToolTip

    Methods

    GetParameters()

    A function that returns the default parameters to use when creating this task

    Used in conjunction with GetUserModifiedParametersFromDefault(IModelLayoutCommon, ServerTaskParameter) so hardcoded values can automatically be set, and the user can be prompted for any other required parameter selections if required

    Declaration
    protected abstract Task<ServerTaskParameter> GetParameters()
    Returns
    Type Description
    Task<ServerTaskParameter>

    A task with the parameters, allowing optional popups to be shown to the user for parameter selection

    Remarks

    For instance:

    protected override Task<ServerTaskParameter> GetParameters()
    {
        var ps = new API.Tasks.Parameters.ResetAccountParameter();
        ps.AccountID = accountID;
        ps.AccountID_Label = accountName;
        return GetUserModifiedParametersFromDefault(Owner, ps);
    }

    GetUserModifiedParametersFromDefault(IModelLayoutCommon, ServerTaskParameter)

    Used to present a popup window to the user to edit the specified parameters for this task before executing it

    Declaration
    public static Task<ServerTaskParameter> GetUserModifiedParametersFromDefault(IModelLayoutCommon owner, ServerTaskParameter param)
    Parameters
    Type Name Description
    IModelLayoutCommon owner

    The owning context for this task

    ServerTaskParameter param

    The parameter to be displayed and edited by the user

    Returns
    Type Description
    Task<ServerTaskParameter>

    The results of any edits made to the user on the param

    InternalExecuteAsync(object)

    Gets the parameters for the task (possibly prompting the user for som if GetParameters() override calls GetUserModifiedParametersFromDefault(IModelLayoutCommon, ServerTaskParameter)) and executes the task locally or against a task service depending on the setup

    The system then also tracks the progress of the task in the application and notifies the user when the task is complete

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

    The command parameter

    Returns
    Type Description
    Task

    A task indicating the completion of the operation

    Overrides
    EPCommand.InternalExecuteAsync(object)

    InternalExecuteUserWarning()

    Provides a mechanism for implementing commands to issue a warning to the user before executing. Can return false to abort the execution.

    Declaration
    protected virtual Task<bool> InternalExecuteUserWarning()
    Returns
    Type Description
    Task<bool>

    True to continue executing the aommand (default)

    ProcessExecute(ServerTaskParameter, bool)

    Performs the actual execution of creating and tracking the task.

    Can be overriden if you have specific implementations, such as export data overrides this to export pure grid data if it does not need to get data from the service

    Declaration
    public virtual Task ProcessExecute(ServerTaskParameter taskParam, bool isKeymodifierPressed)
    Parameters
    Type Name Description
    ServerTaskParameter taskParam

    The task parameter for executing the task

    bool isKeymodifierPressed

    If the key modifier is pressed to run the task locally

    Returns
    Type Description
    Task

    A task indicating the completion of the operation

    ProcessExecute(ServerTaskParameter, bool, ServerTaskOccurrence?, short?)

    Declaration
    public virtual Task ProcessExecute(ServerTaskParameter taskParam, bool isKeymodifierPressed, ServerTaskOccurrence? occurance = null, short? frequency = null)
    Parameters
    Type Name Description
    ServerTaskParameter taskParam
    bool isKeymodifierPressed
    ServerTaskOccurrence? occurance
    short? frequency
    Returns
    Type Description
    Task

    Implements

    IHasChildren<T>
    IHasChildren
    IDisposable
    IEPCommandWithDescriptor
    IEPCommand
    ICommand
    ICommandDescriptor

    Extension Methods

    LinqExtensions.AsArray<T>(T)
    LinqExtensions.ToArrayOfOne<T>(T)
    LinqExtensions.ToListOfOne<T>(T)
    MiscExtensions.SetIfNotEqual<T, TP>(T, Expression<Func<T, TP>>, TP)
    CommandExtensions.CreateCommand(EPCommand, ICommandDescriptor, CommandButtonType, bool, CommandSize)
    CommandExtensions.UpdateCommand(EPCommand, object, ICommandDescriptor, bool, CommandSize)
    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.