AsyncTaskBase Class

Represents a cancellable and completable asynchronous task that can be used even in frameworks that do not support the and keywords.

Definition

Namespace: KGySoft.WinForms
Assembly: KGySoft.WinForms (in KGySoft.WinForms.dll) Version: 5.0.1
C#
public abstract class AsyncTaskBase : IDisposable
Inheritance
Object    AsyncTaskBase
Implements
IDisposable

Constructors

AsyncTaskBaseInitializes a new instance of the AsyncTaskBase class

Properties

IsCanceled Gets whether the task has been canceled.
IsCompleted Gets whether the task has been completed.
IsDisposed Gets whether the task has been disposed.

Methods

Cancel Cancels the task, setting the IsCanceled property to .
DisposePerforms application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Dispose(Boolean) Disposes the resources used by the AsyncTaskBase instance.
SetCompleted Sets the task as completed, allowing any waiting threads to proceed.
Wait Waits for the task to complete, with a specified timeout. This method blocks the calling thread until the task is completed or the specified timeout has elapsed, whichever comes first.
WaitForCompletion Waits for the task to complete. This method blocks the calling thread until the task is completed.

See Also