System.Threading.Tasks.Task
Represents an asynchronous operation.
Returns the unique ID of the currently executing TaskTask.
Gets the state object supplied when the TaskTask was created,
or null if none was supplied.
Gets the TaskCreationOptionsTaskCreationOptions used
to create this task.
Gets the AggregateExceptionException that caused the TaskTask to end prematurely. If the TaskTask completed successfully or has not yet thrown any
exceptions, this will return null.
Gets a unique ID for this TaskTask instance.
Gets whether this TaskTask instance has completed
execution due to being canceled.
Gets whether this TaskTask has completed.
Gets whether the Task completed due to an unhandled exception.
Gets the TaskStatusTaskStatus of this Task.
Initializes a new Task with the specified action.
Initializes a new Task with the specified action and CancellationTokenCancellationToken.
Initializes a new Task with the specified action and creation options.
public Task(Action action, CancellationToken cancellationToken, TaskCreationOptions creationOptions)
Initializes a new Task with the specified action and creation options.
Initializes a new Task with the specified action and state.
Initializes a new Task with the specified action, state, snd options.
Initializes a new Task with the specified action, state, snd options.
public Task(Action<object> action, object state, CancellationToken cancellationToken, TaskCreationOptions creationOptions)
Initializes a new Task with the specified action, state, snd options.
Waits for all of the provided Task objects to complete execution.
Waits for all of the provided Task objects to complete execution.
Waits for all of the provided Task objects to complete execution.
Waits for all of the provided Task objects to complete execution.
public static bool WaitAll(Task[] tasks, int millisecondsTimeout, CancellationToken cancellationToken)
Waits for all of the provided Task objects to complete execution.
Waits for any of the provided Task objects to complete execution.
Waits for any of the provided Task objects to complete execution.
Waits for any of the provided Task objects to complete execution.
Waits for any of the provided Task objects to complete execution.
public static int WaitAny(Task[] tasks, int millisecondsTimeout, CancellationToken cancellationToken)
Waits for any of the provided Task objects to complete execution.
Creates a continuation that executes when the target Task completes.
Creates a continuation that executes when the target Task completes.
Creates a continuation that executes when the target Task completes.
public Task ContinueWith(Action<Task> continuationAction, TaskContinuationOptions continuationOptions)
Creates a continuation that executes when the target Task completes.
public Task ContinueWith(Action<Task> continuationAction, CancellationToken cancellationToken, TaskContinuationOptions continuationOptions, TaskScheduler scheduler)
Creates a continuation that executes when the target Task completes.
Creates a continuation that executes when the target Task completes.
public Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction, CancellationToken cancellationToken)
Creates a continuation that executes when the target Task completes.
public Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction, TaskScheduler scheduler)
Creates a continuation that executes when the target Task completes.
public Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction, TaskContinuationOptions continuationOptions)
Creates a continuation that executes when the target Task completes.
public Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction, CancellationToken cancellationToken, TaskContinuationOptions continuationOptions, TaskScheduler scheduler)
Creates a continuation that executes when the target Task completes.
Runs the Task synchronously on the current TaskSchedulerTaskScheduler.
Runs the Task synchronously on the TaskSchedulerscheduler provided.
Starts the Task, scheduling it for execution to the current TaskSchedulerTaskScheduler.
Starts the Task, scheduling it for execution to the specified TaskSchedulerTaskScheduler.
Waits for the Task to complete execution.
Waits for the Task to complete execution.
Waits for the Task to complete execution.
Waits for the Task to complete execution.
Waits for the Task to complete execution.