Search Results for

    Show / Hide Table of Contents

    Class ClientTaskRunner

    An implementation of the TaskRunnerBase that can execute a provided IServerTask locally on the client application

    Inheritance
    object
    TaskRunnerBase
    ClientTaskRunner
    Implements
    IDisposable
    ITaskRunner
    IProcessor
    Inherited Members
    TaskRunnerBase.CreateUpdater()
    TaskRunnerBase.SetTaskData(IServerTaskData)
    TaskRunnerBase.LogError(Exception, string)
    TaskRunnerBase.RunOnNewThread()
    TaskRunnerBase.Run()
    TaskRunnerBase.Cancel()
    TaskRunnerBase.Kill()
    TaskRunnerBase.FlushPendingMessages()
    TaskRunnerBase.AbortThread()
    TaskRunnerBase.DisposeManaged()
    TaskRunnerBase.Dispose(bool)
    TaskRunnerBase.Dispose()
    TaskRunnerBase.CancelTokenSource
    TaskRunnerBase.Status
    TaskRunnerBase.TaskData
    TaskRunnerBase.TimeFinished
    TaskRunnerBase.TimeCancelled
    TaskRunnerBase.FailedException
    TaskRunnerBase.Processor
    TaskRunnerBase.Services
    TaskRunnerBase.Updater
    TaskRunnerBase.Cache
    TaskRunnerBase.User
    TaskRunnerBase.Reporter
    TaskRunnerBase.Task
    TaskRunnerBase.TimeStarted
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: LemonEdge.Client.Core.Tasks
    Assembly: LemonEdge.ClientCore.dll
    Syntax
    public class ClientTaskRunner : TaskRunnerBase, IDisposable, ITaskRunner, IProcessor

    Constructors

    ClientTaskRunner(IModelLayoutCommon, bool, IServerTask, IServerTaskData, IEntityUpdater, IReadOnlyCache, UserInfo, BusyProgressReporter, CancellationTokenSource)

    Creates a new cliet task runner for executing a server task locally

    Declaration
    public ClientTaskRunner(IModelLayoutCommon host, bool taskIsVirtual, IServerTask task, IServerTaskData data, IEntityUpdater updater, IReadOnlyCache cache, UserInfo user, BusyProgressReporter reporter, CancellationTokenSource cancel)
    Parameters
    Type Name Description
    IModelLayoutCommon host

    The host this task will be executed within

    bool taskIsVirtual

    Indicates if this task has actually been saved in the system. If true the runner will update and save the status of the task, otherwise it won't commit any status changes.

    IServerTask task

    The task to be executed virtually

    IServerTaskData data
    IEntityUpdater updater

    The top level updater context that the task can use to execute its main thread

    IReadOnlyCache cache

    A local cache the task can use

    UserInfo user

    The user the task is currently running under (will be the currently logged in user as the task is running locally)

    BusyProgressReporter reporter

    A class for reporting the status updates for the task. When running locally this would be the ClientTaskProgressDisplayer

    CancellationTokenSource cancel

    Properties

    RunningOnServer

    False - This task is running locally from the client

    Declaration
    protected override bool RunningOnServer { get; }
    Property Value
    Type Description
    bool
    Overrides
    TaskRunnerBase.RunningOnServer

    TaskIsVirtual

    Indicates the task is a fake task not actually saved in the database, so it should not be updated

    By default this is false, indicating the processor is executing real tasks and should update their status, results, etc when complete

    When true this is used by the client to create virtual tasks to just immediately process certain tasks, but can not have their status/etc updated when complete as they do not exist
    Declaration
    protected override bool TaskIsVirtual { get; }
    Property Value
    Type Description
    bool
    Overrides
    TaskRunnerBase.TaskIsVirtual

    Methods

    CreateTaskHandler()

    Returns a handler for processing the task result. Gives priority to any IClientTaskResultHandler to ensure the handler can interact with the client UI if required. Otherwise any found ITaskResultHandler for this task is returned.

    Declaration
    protected override ITaskResultHandler CreateTaskHandler()
    Returns
    Type Description
    ITaskResultHandler

    A handler for processing the task result

    Overrides
    TaskRunnerBase.CreateTaskHandler()

    InternalCreateUpdater()

    Creates a new updater context from the local client connection using Connector.Instance.Create

    Declaration
    protected override Task<IEntityUpdater> InternalCreateUpdater()
    Returns
    Type Description
    Task<IEntityUpdater>

    A new updater context

    Overrides
    TaskRunnerBase.InternalCreateUpdater()

    RunInternal()

    Updates the client UI that this task is running as well as processing it

    Declaration
    protected override Task RunInternal()
    Returns
    Type Description
    Task

    A task indicating the completion of the task running internally

    Overrides
    TaskRunnerBase.RunInternal()

    Implements

    IDisposable
    ITaskRunner
    IProcessor

    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.