Click or drag to resize

TaskCancelController Class

Controls the background execution of a thread or a task.
Inheritance Hierarchy
SystemObject
  Altaxo.Gui.CommonTaskCancelController

Namespace: Altaxo.Gui.Common
Assembly: AltaxoBase (in AltaxoBase.dll) Version: 4.8.3572.0 (4.8.3572.0)
Syntax
C#
public class TaskCancelController : INotifyPropertyChanged, 
	IDisposable

The TaskCancelController type exposes the following members.

Constructors
 NameDescription
Public methodTaskCancelController Initializes a new instance of the TaskCancelController class.
Public methodTaskCancelController(Task, IProgressMonitor, Int32) Initializes a new instance of the TaskCancelController class for a task.
Public methodTaskCancelController(Thread, IProgressMonitor, Int32) Initializes a new instance of the TaskCancelController class for a thread.
Top
Properties
 NameDescription
Public propertyCmdAbandon Gets the command that abandons the operation.
Public propertyCmdCancellationHard Gets the command that requests hard cancellation.
Public propertyCmdCancellationSoft Gets the command that requests soft cancellation.
Public propertyCmdInterrupt Gets the command that interrupts the thread.
Public propertyIsAbandonVisible Gets a value indicating whether the abandon command should be visible.
Public propertyIsCancellationHardVisible Gets a value indicating whether the hard-cancellation command should be visible.
Public propertyIsCancellationSoftVisible Gets a value indicating whether the soft-cancellation command should be visible.
Public propertyIsExecutionInProgress Gets or sets a value indicating whether execution is still in progress.
Public propertyIsInterruptVisible Gets a value indicating whether the interrupt command should be visible.
Protected propertyIsThread Gets a value indicating whether the controller is handling a thread.
Public propertyIsWindowVisible Gets or sets a value indicating whether the progress window should be visible.
Public propertyMonitor Gets or sets the progress monitor used by the controller.
Public propertyProgressText Gets or sets the current progress text.
Public propertyProgressValue Gets or sets the current progress value.
Protected propertyStateOfCancelling Gets or sets the current cancellation state.
Public propertyTitle Gets or sets the dialog title.
Public propertyWasCancelledByUser Gets a value indicating whether the execution was cancelled by the user.
Top
Methods
 NameDescription
Protected methodCreateTimer Creates the polling timer if it does not yet exist.
Public methodDisposePerforms application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Protected methodEhAbandon Handles an abandon request.
Protected methodEhInterrupt Handles an interrupt request.
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodOnPropertyChanged Raises the PropertyChanged event.
Public methodStartExecution Starts execution of the specified action on a background thread.
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Top
Events
 NameDescription
Public eventPropertyChangedOccurs when a property value changes.
Top
Fields
 NameDescription
Protected field_delayMilliseconds Delay before the progress window becomes visible, in milliseconds.
Protected field_timer Polling timer that monitors task or thread completion.
Top
Remarks
There is a property IsWindowVisible, which is set to true after a given amount of time and then set to false when the window should close. There is another property, IsExecutionInProgress, that indicates whether a task or thread is currently executing. A task or thread is stopped in the following order: 1. Signal the CancellationTokenSoft 2. Signal the CancellationTokenHard 3. Interrupt the thread (only works for threads) 4. Abort the thread (only works for threads)
See Also