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
System.Object
CancelTask
Implements
System.IDisposable
System.Windows.Input.ICommand
Inherited Members
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.Tasks
Assembly: ClientCore.dll
Syntax
public class CancelTask : EPCommandWithDescriptor, IHasChildren<EPCommandWithDescriptor>, IHasChildren, IDisposable, IEPCommandWithDescriptor, IEPCommand, ICommand, ICommandDescriptor
Constructors
CancelTask(IModelLayoutCommon, ITaskStatusDisplayer)
Creates a new cancel command for the specified executing task
Declaration
public CancelTask(IModelLayoutCommon owner, ITaskStatusDisplayer taskTracker)
Parameters
| Type | Name | Description |
|---|---|---|
| IModelLayoutCommon | owner | The owning host for the command |
| ITaskStatusDisplayer | taskTracker | The task currently executing and being tracked by the client that this command will cancel |
Properties
Description
Declaration
public override string Description { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Overrides
IconID
Declaration
public override Guid IconID { get; }
Property Value
| Type | Description |
|---|---|
| System.Guid |
Overrides
Title
Declaration
public override string Title { get; }
Property Value
| Type | Description |
|---|---|
| System.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 |
|---|---|---|
| System.Object | parameter | The command parameter |
Returns
| Type | Description |
|---|---|
| System.Boolean | 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 |
|---|---|---|
| System.Object | parameter | The command parameter |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | A task indicating the completion of the operation |
Overrides
Implements
System.IDisposable
System.Windows.Input.ICommand