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
    System.Object
    BaseHasChildren<EPCommandWithDescriptor>
    EPCommand
    EPCommandWithDescriptor
    ViewCommand
    TaskBase
    ExportData
    ResetSystemRoles
    TruncateTable
    RevertTransactionBase<T>
    RunReport
    Implements
    IHasChildren<EPCommandWithDescriptor>
    IHasChildren
    System.IDisposable
    IEPCommandWithDescriptor
    IEPCommand
    System.Windows.Input.ICommand
    ICommandDescriptor
    Inherited Members
    ViewCommand.Type
    EPCommandWithDescriptor.ICommandDescriptor.Title
    EPCommandWithDescriptor.OverlayIconID
    EPCommandWithDescriptor.Parameter
    EPCommandWithDescriptor.HelpURL
    EPCommand.ActiveDisplayerFromOwner
    EPCommand.LoadChildrenAsync()
    EPCommand.ReloadChildrenOnEachOpen
    EPCommand.HasChildCommands
    EPCommand.SetToggler(IHasToggleStatus)
    EPCommand.Seperator
    EPCommand.Owner
    EPCommand.CanExecuteChanged
    EPCommand.OnCanExecuteChanged()
    EPCommand.SubscribeToLayoutChange
    EPCommand.OnLayoutsChanged(IModelLayouHost, LayoutChangeEventArgs)
    EPCommand.ICommand.Execute(Object)
    EPCommand.ExternalExecute(Object)
    EPCommand.InternalExecute(Object)
    EPCommand.LockExecution
    EPCommand.ICommand.CanExecute(Object)
    EPCommand.ExternalCanExecute(Object)
    EPCommand.InternalCanExecute(Object)
    EPCommand.InternalCanExecuteAsync(Object)
    EPCommand.Toggler
    EPCommand.CustomType
    EPCommand.GetModifierText(IEPCommand)
    EPCommand.RemoveEventHandlersOnDispose()
    EPCommand.Dispose(Boolean)
    EPCommand.Dispose()
    BaseHasChildren<EPCommandWithDescriptor>.Order
    BaseHasChildren<EPCommandWithDescriptor>.Children
    BaseHasChildren<EPCommandWithDescriptor>.AddChild(EPCommandWithDescriptor)
    BaseHasChildren<EPCommandWithDescriptor>.DeleteChild(EPCommandWithDescriptor)
    BaseHasChildren<EPCommandWithDescriptor>.ClearChildren()
    BaseHasChildren<EPCommandWithDescriptor>.Parent
    BaseHasChildren<EPCommandWithDescriptor>.AddChild(IHasChildren)
    BaseHasChildren<EPCommandWithDescriptor>.DeleteChild(IHasChildren)
    BaseHasChildren<EPCommandWithDescriptor>.IHasChildren.Children
    BaseHasChildren<EPCommandWithDescriptor>.IHasChildren.Parent
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: LemonEdge.Client.Core.Commands.ViewCommands
    Assembly: ClientCore.dll
    Syntax
    public abstract class TaskBase : ViewCommand, IHasChildren<EPCommandWithDescriptor>, IHasChildren, IDisposable, IEPCommandWithDescriptor, IEPCommand, ICommand, ICommandDescriptor

    Constructors

    TaskBase(Boolean, IModelLayoutCommon, Guid)

    Creates a new TaskBase command

    Declaration
    public TaskBase(bool runOnServer, IModelLayoutCommon owner, Guid taskType)
    Parameters
    Type Name Description
    System.Boolean 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 )

    IModelLayoutCommon owner

    The owner context this command is executed from within

    System.Guid taskType

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

    Properties

    Description

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

    IconID

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

    IncludeInSimple

    Declaration
    public override bool IncludeInSimple { get; }
    Property Value
    Type Description
    System.Boolean
    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
    System.Boolean

    Key

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

    ModifierKeys

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

    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
    System.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

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

    ToolTip

    Declaration
    public override string ToolTip { get; }
    Property Value
    Type Description
    System.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
    System.Threading.Tasks.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
    System.Threading.Tasks.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
    System.Object parameter

    The command parameter

    Returns
    Type Description
    System.Threading.Tasks.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
    System.Threading.Tasks.Task<System.Boolean>

    True to continue executing the aommand (default)

    ProcessExecute(ServerTaskParameter, Boolean)

    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

    System.Boolean isKeymodifierPressed

    If the key modifier is pressed to run the task locally

    Returns
    Type Description
    System.Threading.Tasks.Task

    A task indicating the completion of the operation

    Implements

    IHasChildren<T>
    IHasChildren
    System.IDisposable
    IEPCommandWithDescriptor
    IEPCommand
    System.Windows.Input.ICommand
    ICommandDescriptor

    Extension Methods

    MiscExtensions.SetIfNotEqual<T, P>(T, Expression<Func<T, P>>, P)
    ReflectionExtensions.ClearEventInvocations(Object, String)
    StringExtensions.ToCSVFormatString(Object, Type)
    SQLExtensions.ToSQLValue(Object, Boolean)
    CommandExtensions.CreateCommand(EPCommand, ICommandDescriptor, CommandButtonType, Boolean, CommandSize)
    CommandExtensions.UpdateCommand(EPCommand, Object, ICommandDescriptor, Boolean, CommandSize)
    In This Article
    Back to top © LemonTree Software Ltd. All rights reserved.