System.Threading.Tasks.Task Members

The members of System.Threading.Tasks.Task are listed below.

See Also: Inherited members from System.Object

Public Constructors

Initializes a new System.Threading.Tasks.Task with the specified action.

Initializes a new System.Threading.Tasks.Task with the specified action and System.Threading.CancellationToken.

Initializes a new System.Threading.Tasks.Task with the specified action and creation options.

Initializes a new System.Threading.Tasks.Task with the specified action and state.

Initializes a new System.Threading.Tasks.Task with the specified action and creation options.

Initializes a new System.Threading.Tasks.Task with the specified action, state, and options.

Initializes a new System.Threading.Tasks.Task with the specified action, state, and options.

Initializes a new System.Threading.Tasks.Task with the specified action, state, and options.

Public Properties

[read-only]
AsyncStateobject.

Gets the state object supplied when the System.Threading.Tasks.Task was created, or null if none was supplied.

[read-only]
CreationOptionsSystem.Threading.Tasks.TaskCreationOptions.

Gets the System.Threading.Tasks.TaskCreationOptions used to create this task.

[read-only]
static
CurrentIdNullable<int>.

Returns the unique ID of the currently executing System.Threading.Tasks.Task.

[read-only]
ExceptionAggregateException.

Gets the AggregateException that caused the System.Threading.Tasks.Task to end prematurely. If the System.Threading.Tasks.Task completed successfully or has not yet thrown any exceptions, this will return null.

[read-only]
static
FactorySystem.Threading.Tasks.TaskFactory.

Provides access to factory methods for creating System.Threading.Tasks.Task and System.Threading.Tasks.Task`1 instances.

[read-only]
Idint.

Gets a unique ID for this System.Threading.Tasks.Task instance.

[read-only]
IsCanceledbool.

Gets whether this System.Threading.Tasks.Task instance has completed execution due to being canceled.

[read-only]
IsCompletedbool.

Gets whether this System.Threading.Tasks.Task has completed.

[read-only]
IsFaultedbool.

Gets whether the System.Threading.Tasks.Task completed due to an unhandled exception.

[read-only]
StatusSystem.Threading.Tasks.TaskStatus.

Gets the System.Threading.Tasks.TaskStatus of this task.

Public Methods

ConfigureAwait(bool) : System.Runtime.CompilerServices.ConfiguredTaskAwaitable

Configures an awaiter used to await this System.Threading.Tasks.Task.

ContinueWith(Action<System.Threading.Tasks.Task>) : System.Threading.Tasks.Task

Creates a continuation that executes asynchronously when the target System.Threading.Tasks.Task completes.

ContinueWith(Action<System.Threading.Tasks.Task, object>, object) : System.Threading.Tasks.Task

Creates a continuation that executes when the target System.Threading.Tasks.Task completes.

ContinueWith(Action<System.Threading.Tasks.Task>, CancellationToken) : System.Threading.Tasks.Task

Creates a continuation that executes asynchronously when the target System.Threading.Tasks.Task completes.

ContinueWith(Action<System.Threading.Tasks.Task>, System.Threading.Tasks.TaskContinuationOptions) : System.Threading.Tasks.Task

Creates a continuation that executes according to the specified System.Threading.Tasks.TaskContinuationOptions.

ContinueWith(Action<System.Threading.Tasks.Task>, System.Threading.Tasks.TaskScheduler) : System.Threading.Tasks.Task

Creates a continuation that executes asynchronously when the target System.Threading.Tasks.Task completes.

ContinueWith(Action<System.Threading.Tasks.Task, object>, object, CancellationToken) : System.Threading.Tasks.Task

Creates a continuation that executes when the target System.Threading.Tasks.Task completes.

ContinueWith(Action<System.Threading.Tasks.Task, object>, object, System.Threading.Tasks.TaskContinuationOptions) : System.Threading.Tasks.Task

Creates a continuation that executes when the target System.Threading.Tasks.Task completes.

ContinueWith(Action<System.Threading.Tasks.Task, object>, object, System.Threading.Tasks.TaskScheduler) : System.Threading.Tasks.Task

Creates a continuation that executes when the target System.Threading.Tasks.Task completes.

ContinueWith(Action<System.Threading.Tasks.Task>, CancellationToken, System.Threading.Tasks.TaskContinuationOptions, System.Threading.Tasks.TaskScheduler) : System.Threading.Tasks.Task

Creates a continuation that executes according to the specified System.Threading.Tasks.TaskContinuationOptions.

ContinueWith(Action<System.Threading.Tasks.Task, object>, object, CancellationToken, System.Threading.Tasks.TaskContinuationOptions, System.Threading.Tasks.TaskScheduler) : System.Threading.Tasks.Task

Creates a continuation that executes when the target System.Threading.Tasks.Task completes.

ContinueWith<TResult>(Func<System.Threading.Tasks.Task, TResult>) : System.Threading.Tasks.Task<TResult>

Creates a continuation that executes asynchronously when the target System.Threading.Tasks.Task completes.

ContinueWith<TResult>(Func<System.Threading.Tasks.Task, object, TResult>, object) : System.Threading.Tasks.Task<TResult>

Creates a continuation that executes when the target System.Threading.Tasks.Task completes.

ContinueWith<TResult>(Func<System.Threading.Tasks.Task, TResult>, CancellationToken) : System.Threading.Tasks.Task<TResult>

Creates a continuation that executes asynchronously when the target System.Threading.Tasks.Task completes.

ContinueWith<TResult>(Func<System.Threading.Tasks.Task, TResult>, System.Threading.Tasks.TaskContinuationOptions) : System.Threading.Tasks.Task<TResult>

Creates a continuation that executes according to the condition specified in continuationOptions.

ContinueWith<TResult>(Func<System.Threading.Tasks.Task, TResult>, System.Threading.Tasks.TaskScheduler) : System.Threading.Tasks.Task<TResult>

Creates a continuation that executes asynchronously when the target System.Threading.Tasks.Task completes.

ContinueWith<TResult>(Func<System.Threading.Tasks.Task, object, TResult>, object, CancellationToken) : System.Threading.Tasks.Task<TResult>

Creates a continuation that executes when the target System.Threading.Tasks.Task completes.

ContinueWith<TResult>(Func<System.Threading.Tasks.Task, object, TResult>, object, System.Threading.Tasks.TaskContinuationOptions) : System.Threading.Tasks.Task<TResult>

Creates a continuation that executes when the target System.Threading.Tasks.Task completes.

ContinueWith<TResult>(Func<System.Threading.Tasks.Task, object, TResult>, object, System.Threading.Tasks.TaskScheduler) : System.Threading.Tasks.Task<TResult>

Creates a continuation that executes when the target System.Threading.Tasks.Task completes.

ContinueWith<TResult>(Func<System.Threading.Tasks.Task, TResult>, CancellationToken, System.Threading.Tasks.TaskContinuationOptions, System.Threading.Tasks.TaskScheduler) : System.Threading.Tasks.Task<TResult>

Creates a continuation that executes according to the condition specified in continuationOptions.

ContinueWith<TResult>(Func<System.Threading.Tasks.Task, object, TResult>, object, CancellationToken, System.Threading.Tasks.TaskContinuationOptions, System.Threading.Tasks.TaskScheduler) : System.Threading.Tasks.Task<TResult>

Creates a continuation that executes when the target System.Threading.Tasks.Task completes.

static
Delay(int) : System.Threading.Tasks.Task

Creates a task that will complete after a time delay.

static
Delay(TimeSpan) : System.Threading.Tasks.Task

Creates a task that will complete after a time delay.

static
Delay(int, CancellationToken) : System.Threading.Tasks.Task

Creates a task that will complete after a time delay.

static
Delay(TimeSpan, CancellationToken) : System.Threading.Tasks.Task

Creates a task that will complete after a time delay.

Dispose()

Releases all resources used by the current instance of the System.Threading.Tasks.Task class.

static
FromResult<TResult>(TResult) : System.Threading.Tasks.Task<TResult>
Documentation for this section has not yet been entered.
GetAwaiter() : System.Runtime.CompilerServices.TaskAwaiter

Gets an awaiter used to await this System.Threading.Tasks.Task.

static
Run(Action) : System.Threading.Tasks.Task

Queues the specified work to run on the ThreadPool and returns a task handle for that work.

static
Run(Func<System.Threading.Tasks.Task>) : System.Threading.Tasks.Task

Queues the specified work to run on the ThreadPool and returns a proxy for the task returned by function.

static
Run(Action, CancellationToken) : System.Threading.Tasks.Task

Queues the specified work to run on the ThreadPool and returns a task handle for that work.

static
Run(Func<System.Threading.Tasks.Task>, CancellationToken) : System.Threading.Tasks.Task

Queues the specified work to run on the ThreadPool and returns a proxy for the task returned by function.

static
Run<TResult>(Func<System.Threading.Tasks.Task<TResult>>) : System.Threading.Tasks.Task<TResult>

Queues the specified work to run on the ThreadPool and returns a proxy for the Task(TResult) returned by function.

static
Run<TResult>(Func<TResult>) : System.Threading.Tasks.Task<TResult>

Queues the specified work to run on the ThreadPool and returns a Task(TResult) handle for that work.

static
Run<TResult>(Func<System.Threading.Tasks.Task<TResult>>, CancellationToken) : System.Threading.Tasks.Task<TResult>

Queues the specified work to run on the ThreadPool and returns a proxy for the Task(TResult) returned by function.

static
Run<TResult>(Func<TResult>, CancellationToken) : System.Threading.Tasks.Task<TResult>

Queues the specified work to run on the thread pool and returns a Task(TResult) handle for that work.

RunSynchronously()

Runs the System.Threading.Tasks.Task synchronously on the current System.Threading.Tasks.TaskScheduler.

RunSynchronously(System.Threading.Tasks.TaskScheduler)

Runs the System.Threading.Tasks.Task synchronously on the System.Threading.Tasks.TaskScheduler provided.

Start()

Starts the System.Threading.Tasks.Task, scheduling it for execution to the current System.Threading.Tasks.TaskScheduler.

Start(System.Threading.Tasks.TaskScheduler)

Starts the System.Threading.Tasks.Task, scheduling it for execution to the specified System.Threading.Tasks.TaskScheduler.

Wait()

Waits for the System.Threading.Tasks.Task to complete execution.

Wait(int) : bool

Waits for the System.Threading.Tasks.Task to complete execution within a specified number of milliseconds.

Wait(CancellationToken)

Waits for the cancellable System.Threading.Tasks.Task to complete execution.

Wait(TimeSpan) : bool

Waits for the System.Threading.Tasks.Task to complete execution within a specified time interval.

Wait(int, CancellationToken) : bool

Waits for the cancellable System.Threading.Tasks.Task to complete execution.

static
WaitAll(params System.Threading.Tasks.Task[])

Waits for all of the provided System.Threading.Tasks.Task objects to complete execution.

static
WaitAll(System.Threading.Tasks.Task[], int) : bool

Waits for all of the provided System.Threading.Tasks.Task objects to complete execution within a specified number of milliseconds.

static
WaitAll(System.Threading.Tasks.Task[], CancellationToken)

Waits for all of the provided cancellable System.Threading.Tasks.Task objects to complete execution.

static
WaitAll(System.Threading.Tasks.Task[], TimeSpan) : bool

Waits for all of the provided cancellable System.Threading.Tasks.Task objects to complete execution within a specified time interval.

static
WaitAll(System.Threading.Tasks.Task[], int, CancellationToken) : bool

Waits for all of the provided cancellable System.Threading.Tasks.Task objects to complete execution within a specified number of milliseconds.

static
WaitAny(params System.Threading.Tasks.Task[]) : int

Waits for any of the provided System.Threading.Tasks.Task objects to complete execution.

static
WaitAny(System.Threading.Tasks.Task[], int) : int

Waits for any of the provided System.Threading.Tasks.Task objects to complete execution within a specified number of milliseconds.

static
WaitAny(System.Threading.Tasks.Task[], CancellationToken) : int

Waits for any of the provided cancellable System.Threading.Tasks.Task objects to complete execution.

static
WaitAny(System.Threading.Tasks.Task[], TimeSpan) : int

Waits for any of the provided System.Threading.Tasks.Task objects to complete execution within a specified time interval.

static
WaitAny(System.Threading.Tasks.Task[], int, CancellationToken) : int

Waits for any of the provided cancellable System.Threading.Tasks.Task objects to complete execution within a specified number of milliseconds.

static
WhenAll(IEnumerable<System.Threading.Tasks.Task>) : System.Threading.Tasks.Task

Creates a task that will complete when all of the supplied tasks have completed.

static
WhenAll(params System.Threading.Tasks.Task[]) : System.Threading.Tasks.Task

Creates a task that will complete when all of the supplied tasks have completed.

static
WhenAll<TResult>(IEnumerable<System.Threading.Tasks.Task<TResult>>) : System.Threading.Tasks.Task<TResult[]>

Creates a task that will complete when all of the supplied tasks have completed.

static
WhenAll<TResult>(params System.Threading.Tasks.Task<TResult>[]) : System.Threading.Tasks.Task<TResult[]>

Creates a task that will complete when all of the supplied tasks have completed.

static
WhenAny(IEnumerable<System.Threading.Tasks.Task>) : System.Threading.Tasks.Task<System.Threading.Tasks.Task>

Creates a task that will complete when any of the supplied tasks have completed.

static
WhenAny(params System.Threading.Tasks.Task[]) : System.Threading.Tasks.Task<System.Threading.Tasks.Task>

Creates a task that will complete when any of the supplied tasks have completed.

static
WhenAny<TResult>(IEnumerable<System.Threading.Tasks.Task<TResult>>) : System.Threading.Tasks.Task<System.Threading.Tasks.Task<TResult>>

Creates a task that will complete when any of the supplied tasks have completed.

static
WhenAny<TResult>(params System.Threading.Tasks.Task<TResult>[]) : System.Threading.Tasks.Task<System.Threading.Tasks.Task<TResult>>

Creates a task that will complete when any of the supplied tasks have completed.

static
Yield() : System.Runtime.CompilerServices.YieldAwaitable

Creates an awaitable task that asynchronously yields back to the current context when awaited.

Protected Methods

Dispose(bool)

Disposes the System.Threading.Tasks.Task, releasing all of its unmanaged resources.

Explicitly Implemented Interface Members

[read-only]
IAsyncResult.AsyncWaitHandleWaitHandle.

Gets a System.Threading.WaitHandle that can be used to wait for the task to complete.

[read-only]
IAsyncResult.CompletedSynchronouslybool.

Gets an indication of whether the operation completed synchronously.