Class CancelTask
This command is used to cancel the specified IServerTask by setting Cancel to true which the task service uses to activate the CancellationToken used by any task.
Inheritance
CancelTask
Implements
Inherited Members
Namespace: LemonEdge.Client.Core.Tasks
Assembly: LemonEdge.ClientCore.dll
Syntax
public class CancelTask : EPCommandWithDescriptor, IHasChildren<EPCommandWithDescriptor>, IHasChildren, IDisposable, IEPCommandWithDescriptor, IEPCommand, ICommand, ICommandDescriptor
Constructors
CancelTask(IRootController, ITaskStatusDisplayer)
Creates a new cancel command for the specified executing task
Declaration
public CancelTask(IRootController root, ITaskStatusDisplayer taskTracker)
Parameters
| Type | Name | Description |
|---|---|---|
| IRootController | root | The root controller for service access |
| ITaskStatusDisplayer | taskTracker | The task currently executing and being tracked by the client that this command will cancel |
Properties
Description
A user friendly description of this command
Declaration
public override string Description { get; }
Property Value
| Type | Description |
|---|---|
| string |
Overrides
IconID
Declaration
public override Guid IconID { get; }
Property Value
| Type | Description |
|---|---|
| Guid |
Overrides
Title
The title of this command
Declaration
public override string Title { get; }
Property Value
| Type | Description |
|---|---|
| string |
Overrides
Methods
InternalCanExecute(object)
Indicates this command can only be executed if the state of the task being tracked is still Running
Declaration
public override bool InternalCanExecute(object parameter)
Parameters
| Type | Name | Description |
|---|---|---|
| object | parameter | The command parameter |
Returns
| Type | Description |
|---|---|
| bool | True if the state of the task being tracked is still Running |
Overrides
InternalExecuteAsync(object)
Cancels the task by calling Cancel()
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 |