mscorlib 4.0.0.0 System.Object System.IAsyncResult System.IDisposable System.Diagnostics.DebuggerDisplay("Id = {Id}, Status = {Status}") System.Diagnostics.DebuggerTypeProxy(typeof(System.Threading.Tasks.TaskDebuggerView))

instances may be created in a variety of ways. The most common approach is by using the task’s property to retrieve a instance that can be used to create tasks for several purposes. For example, to create a that runs an action, the factory's method may be used:

`// C# var t = Task.Factory.StartNew(() => DoAction()); ' Visual Basic Dim t = Task.Factory.StartNew(Function() DoAction())`

For more complete examples, see Task Parallelism (Task Parallel Library).

The class also provides constructors that initialize the task but that do not schedule it for execution. For performance reasons, the task factory’s method should be the preferred mechanism for creating and scheduling computational tasks, but for scenarios where creation and scheduling must be separated, the constructors may be used, and the task's method may then be used to schedule the task for execution at a later time.

For operations that return values, the class should be used.

## For Debugger Developers

For developers implementing custom debuggers, several internal and private members of task may be useful (these may change from release to release). The m_taskId field serves as the backing store for the property, however accessing this field directly from a debugger may be more efficient than accessing the same value through the property's getter method (the s_taskIdCounter counter is used to retrieve the next available ID for a task). Similarly, the m_stateFlags field stores information about the current lifecycle stage of the task, information also accessible through the property. The m_action field stores a reference to the task's delegate, and the m_stateObject field stores the async state passed to the task by the developer. Finally, for debuggers that parse stack frames, the InternalWait method serves a potential marker for when a task is entering a wait operation.

Represents an asynchronous operation.

- Constructor
  4.0.0.0

  Rather than calling this constructor, the most common way to instantiate a object and launch a task is by calling the static and methods.

  Initializes a new with the specified action.

  The delegate that represents the code to execute in the task.
- Constructor
  4.0.0.0

  Rather than calling this constructor, the most common way to instantiate a object and launch a task is by calling the static and methods.

  For more information, see Task Parallelism (Task Parallel Library) and Cancellation.

  Initializes a new with the specified action and .

  The delegate that represents the code to execute in the task.
  The that the new task will observe.
- Constructor
  4.0.0.0

  Rather than calling this constructor, the most common way to instantiate a object and launch a task is by calling the static method.

  Initializes a new with the specified action and creation options.

  The delegate that represents the code to execute in the task.
  The used to customize the task's behavior.
- Constructor
  4.0.0.0

  Rather than calling this constructor, the most common way to instantiate a object and launch a task is by calling the static method.

  Initializes a new with the specified action and state.

  The delegate that represents the code to execute in the task.
  An object representing data to be used by the action.
- Constructor
  4.0.0.0

  Rather than calling this constructor, the most common way to instantiate a object and launch a task is by calling the static method.

  For more information, see Task Parallelism (Task Parallel Library) and Task Cancellation.

  Initializes a new with the specified action and creation options.

  The delegate that represents the code to execute in the task.
  The that the new task will observe.
  The used to customize the task's behavior.
- Constructor
  4.0.0.0

  Rather than calling this constructor, the most common way to instantiate a object and launch a task is by calling the static method.

  Initializes a new with the specified action, state, and options.

  The delegate that represents the code to execute in the task.
  An object representing data to be used by the action.
  The that that the new task will observe.
- Constructor
  4.0.0.0

  Rather than calling this constructor, the most common way to instantiate a object and launch a task is by calling the static method.

  Initializes a new with the specified action, state, and options.

  The delegate that represents the code to execute in the task.
  An object representing data to be used by the action.
  The used to customize the task's behavior.
- Constructor
  4.0.0.0

  Rather than calling this constructor, the most common way to instantiate a object and launch a task is by calling the static method.

  Initializes a new with the specified action, state, and options.

  The delegate that represents the code to execute in the task.
  An object representing data to be used by the action.
  The that that the new task will observe..
  The used to customize the task's behavior.
- Property
  4.0.0.0
  System.Object To be added.

  Cast the object back to the original type to retrieve its data.

  Gets the state object supplied when the was created, or null if none was supplied.

- Method
  4.0.0.0
  System.Runtime.CompilerServices.ConfiguredTaskAwaitable `` To be added.

  Configures an awaiter used to await this .

  An object used to await this task.

  true to attempt to marshal the continuation back to the original context captured; otherwise, false.
- Method
  4.0.0.0
  System.Threading.Tasks.Task ``

  The returned will not be scheduled for execution until the current task has completed, whether it completes due to running to completion successfully, faulting due to an unhandled exception, or exiting out early due to being canceled.

  Creates a continuation that executes asynchronously when the target completes.

  A new continuation .

  An action to run when the completes. When run, the delegate will be passed the completed task as an argument.
- Method
  4.0.0.0
  System.Threading.Tasks.Task `` ``

  The returned will not be scheduled for execution until the current task has completed, whether it completes due to running to completion successfully, faulting due to an unhandled exception, or exiting out early due to being canceled.

  Creates a continuation that executes when the target completes.

  A new continuation .

  An action to run when the completes. When run, the delegate will be passed the completed task as and the caller-supplied state object as arguments. An object representing data to be used by the continuation action.
- Method
  4.0.0.0
  System.Threading.Tasks.Task `` ``

  The returned will not be scheduled for execution until the current task has completed, whether it completes due to running to completion successfully, faulting due to an unhandled exception, or exiting out early due to being canceled.

  Creates a continuation that executes asynchronously when the target completes.

  A new continuation .

  An action to run when the completes. When run, the delegate will be passed the completed task as an argument. The that will be assigned to the new continuation task.
- Method
  4.0.0.0
  System.Threading.Tasks.Task `` ``

  The returned will not be scheduled for execution until the current task has completed. If the continuation criteria specified through the parameter are not met, the continuation task will be canceled instead of scheduled.

  Creates a continuation that executes according to the specified .

  A new continuation .

  An action to run according to the specified . When run, the delegate will be passed the completed task as an argument. Options for when the continuation is scheduled and how it behaves. This includes criteria, such as , as well as execution options, such as .
- Method
  4.0.0.0
  System.Threading.Tasks.Task `` ``

  The returned will not be scheduled for execution until the current task has completed, whether it completes due to running to completion successfully, faulting due to an unhandled exception, or exiting out early due to being canceled.

  Creates a continuation that executes asynchronously when the target completes.

  A new continuation .

  An action to run when the completes. When run, the delegate will be passed the completed task as an argument. The to associate with the continuation task and to use for its execution.
- Method
  4.0.0.0
  System.Threading.Tasks.Task `` `` ``

  The returned will not be scheduled for execution until the current task has completed, whether it completes due to running to completion successfully, faulting due to an unhandled exception, or exiting out early due to being canceled.

  Creates a continuation that executes when the target completes.

  A new continuation .

  An action to run when the completes. When run, the delegate will be passed the completed task and the caller-supplied state object as arguments. An object representing data to be used by the continuation action. The that will be assigned to the new continuation task.
- Method
  4.0.0.0
  System.Threading.Tasks.Task `` `` ``

  The returned will not be scheduled for execution until the current task has completed. If the continuation criteria specified through the parameter are not met, the continuation task will be canceled instead of scheduled.

  Creates a continuation that executes when the target completes.

  A new continuation .

  An action to run when the completes. When run, the delegate will be passed the completed task and the caller-supplied state object as arguments. An object representing data to be used by the continuation action. Options for when the continuation is scheduled and how it behaves. This includes criteria, such as , as well as execution options, such as .
- Method
  4.0.0.0
  System.Threading.Tasks.Task `` `` ``

  The returned will not be scheduled for execution until the current task has completed, whether it completes due to running to completion successfully, faulting due to an unhandled exception, or exiting out early due to being canceled.

  Creates a continuation that executes when the target completes.

  A new continuation .

  An action to run when the completes. When run, the delegate will be passed the completed task and the caller-supplied state object as arguments. An object representing data to be used by the continuation action. The to associate with the continuation task and to use for its execution.
- Method
  4.0.0.0
  System.Threading.Tasks.Task `` `` `` ``

  The returned will not be scheduled for execution until the current task has completed. If the criteria specified through the parameter are not met, the continuation task will be canceled instead of scheduled.

  Creates a continuation that executes according to the specified .

  A new continuation .

  An action to run according to the specified . When run, the delegate will be passed the completed task as an argument. The that will be assigned to the new continuation task. Options for when the continuation is scheduled and how it behaves. This includes criteria, such as , as well as execution options, such as . The to associate with the continuation task and to use for its execution.
- Method
  4.0.0.0
  System.Threading.Tasks.Task `` `` `` `` ``

  The returned will not be scheduled for execution until the current task has completed. If the criteria specified through the parameter are not met, the continuation task will be canceled instead of scheduled.

  Creates a continuation that executes when the target completes.

  A new continuation .

  An action to run when the completes. When run, the delegate will be passed the completed task and the caller-supplied state object as arguments. An object representing data to be used by the continuation action. The that will be assigned to the new continuation task. Options for when the continuation is scheduled and how it behaves. This includes criteria, such as , as well as execution options, such as . The to associate with the continuation task and to use for its execution.
- Method
  4.0.0.0
  System.Threading.Tasks.Task<TResult> ``

  The returned will not be scheduled for execution until the current task has completed, whether it completes due to running to completion successfully, faulting due to an unhandled exception, or exiting out early due to being canceled.

  Creates a continuation that executes asynchronously when the target completes.

  A new continuation .

  A function to run when the completes. When run, the delegate will be passed the completed task as an argument. The type of the result produced by the continuation.
- Method
  4.0.0.0
  System.Threading.Tasks.Task<TResult> `` ``

  The returned will not be scheduled for execution until the current task has completed, whether it completes due to running to completion successfully, faulting due to an unhandled exception, or exiting out early due to being canceled.

  Creates a continuation that executes when the target completes.

  A new continuation .

  A function to run when the completes. When run, the delegate will be passed the completed task and the caller-supplied state object as arguments. An object representing data to be used by the continuation function. The type of the result produced by the continuation.
- Method
  4.0.0.0
  System.Threading.Tasks.Task<TResult> `` ``

  The returned will not be scheduled for execution until the current task has completed, whether it completes due to running to completion successfully, faulting due to an unhandled exception, or exiting out early due to being canceled.

  Creates a continuation that executes asynchronously when the target completes.

  A new continuation .

  A function to run when the completes. When run, the delegate will be passed the completed task as an argument. The that will be assigned to the new continuation task. The type of the result produced by the continuation.
- Method
  4.0.0.0
  System.Threading.Tasks.Task<TResult> `` ``

  The returned will not be scheduled for execution until the current task has completed. If the continuation criteria specified through the parameter are not met, the continuation task will be canceled instead of scheduled.

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

  A new continuation .

  A function to run according to the condition specified in . When run, the delegate will be passed the completed task as an argument. Options for when the continuation is scheduled and how it behaves. This includes criteria, such as , as well as execution options, such as . The type of the result produced by the continuation.
- Method
  4.0.0.0
  System.Threading.Tasks.Task<TResult> `` ``

  The returned will not be scheduled for execution until the current task has completed, whether it completes due to running to completion successfully, faulting due to an unhandled exception, or exiting out early due to being canceled.

  Creates a continuation that executes asynchronously when the target completes.

  A new continuation .

  A function to run when the completes. When run, the delegate will be passed the completed task as an argument. The to associate with the continuation task and to use for its execution. The type of the result produced by the continuation.
- Method
  4.0.0.0
  System.Threading.Tasks.Task<TResult> `` `` ``

  The returned will not be scheduled for execution until the current task has completed, whether it completes due to running to completion successfully, faulting due to an unhandled exception, or exiting out early due to being canceled.

  Creates a continuation that executes when the target completes.

  A new continuation .

  A function to run when the completes. When run, the delegate will be passed the completed task and the caller-supplied state object as arguments. An object representing data to be used by the continuation function. The that will be assigned to the new continuation task. The type of the result produced by the continuation.
- Method
  4.0.0.0
  System.Threading.Tasks.Task<TResult> `` `` ``

  The returned will not be scheduled for execution until the current task has completed. If the continuation criteria specified through the parameter are not met, the continuation task will be canceled instead of scheduled.

  Creates a continuation that executes when the target completes.

  A new continuation .

  A function to run when the completes. When run, the delegate will be passed the completed task and the caller-supplied state object as arguments. An object representing data to be used by the continuation function. Options for when the continuation is scheduled and how it behaves. This includes criteria, such as , as well as execution options, such as . The type of the result produced by the continuation.
- Method
  4.0.0.0
  System.Threading.Tasks.Task<TResult> `` `` ``

  The returned will not be scheduled for execution until the current task has completed, whether it completes due to running to completion successfully, faulting due to an unhandled exception, or exiting out early due to being canceled.

  Creates a continuation that executes when the target completes.

  A new continuation .

  A function to run when the completes. When run, the delegate will be passed the completed task and the caller-supplied state object as arguments. An object representing data to be used by the continuation function. The to associate with the continuation task and to use for its execution. The type of the result produced by the continuation.
- Method
  4.0.0.0
  System.Threading.Tasks.Task<TResult> `` `` `` ``

  The returned will not be scheduled for execution until the current task has completed. If the criteria specified through the parameter are not met, the continuation task will be canceled instead of scheduled.

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

  A new continuation .

  A function to run according to the specified When run, the delegate will be passed the completed task as an argument. The that will be assigned to the new continuation task. Options for when the continuation is scheduled and how it behaves. This includes criteria, such as , as well as execution options, such as . The to associate with the continuation task and to use for its execution. The type of the result produced by the continuation.
- Method
  4.0.0.0
  System.Threading.Tasks.Task<TResult> `` `` `` `` ``

  The returned will not be scheduled for execution until the current task has completed. If the criteria specified through the parameter are not met, the continuation task will be canceled instead of scheduled.

  Creates a continuation that executes when the target completes.

  A new continuation .

  A function to run when the completes. When run, the delegate will be passed the completed task and the caller-supplied state object as arguments. An object representing data to be used by the continuation function. The that will be assigned to the new continuation task. Options for when the continuation is scheduled and how it behaves. This includes criteria, such as , as well as execution options, such as . The to associate with the continuation task and to use for its execution. The type of the result produced by the continuation.
- Property
  4.0.0.0
  System.Threading.Tasks.TaskCreationOptions To be added. To be added.

  Gets the used to create this task.

- Property
  4.0.0.0
  System.Nullable<System.Int32> To be added. To be added.

  Returns the unique ID of the currently executing .

- Method
  4.0.0.0
  System.Threading.Tasks.Task ``

  After the specified time delay, the task is completed in RanToCompletion state.

  Creates a task that will complete after a time delay.

  A task that represents the time delay

  The number of milliseconds to wait before completing the returned task
- Method
  4.0.0.0
  System.Threading.Tasks.Task ``

  After the specified time delay, the task is completed in state.

  Creates a task that will complete after a time delay.

  A task that represents the time delay

  The time span to wait before completing the returned task
- Method
  4.0.0.0
  System.Threading.Tasks.Task `` ``

  If the cancellation token is signaled before the specified time delay, then the task is completed in Canceled state. Otherwise, the task is completed in RanToCompletion state once the specified time delay has expired.

  Creates a task that will complete after a time delay.

  A task that represents the time delay

  The number of milliseconds to wait before completing the returned task The cancellation token that will be checked prior to completing the returned task
- Method
  4.0.0.0
  System.Threading.Tasks.Task `` ``

  If the cancellation token is signaled before the specified time delay, then the task is completed in state. Otherwise, the task is completed in state once the specified time delay has expired.

  Creates a task that will complete after a time delay.

  A task that represents the time delay

  The time span to wait before completing the returned task The cancellation token that will be checked prior to completing the returned task
- Method
  4.0.0.0
  System.Void To be added.

  Releases all resources used by the current instance of the class.

- Method
  4.0.0.0
  System.Void ``

  Unlike most of the members of , this method is not thread-safe.

  Disposes the , releasing all of its unmanaged resources.

  A Boolean value that indicates whether this method is being called due to a call to .
- Property
  4.0.0.0
  System.AggregateException To be added.

  Tasks that throw unhandled exceptions store the resulting exception and propagate it wrapped in a in calls to or in accesses to the property. Any exceptions not observed by the time the task instance is garbage collected will be propagated on the finalizer thread. For more information and an example, see Exception Handling (Task Parallel Library).

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

- Property
  4.0.0.0
  System.Threading.Tasks.TaskFactory To be added.

  The factory returned from is a default instance of , as would result from using the default constructor on task factory. The most common use of this property is to create a new task and start it in one call to . For an example, see How to: Return a Value from a Task.

  Provides access to factory methods for creating and instances.

- Method
  4.0.0.0
  System.Threading.Tasks.Task<TResult> `` To be added. To be added. To be added. To be added. To be added.
- Method
  4.0.0.0
  System.Runtime.CompilerServices.TaskAwaiter

  This method is intended for compiler user rather than use directly in code.

  Gets an awaiter used to await this .

  An awaiter instance.

- Property
  4.0.0.0
  System.Int32 To be added.

  Task IDs are assigned on-demand and do not necessarily represent the order in the which task instances were created.

  Gets a unique ID for this instance.

- Property
  4.0.0.0
  System.Boolean To be added.

  A will complete in Canceled state either if its was marked for cancellation before the task started executing, or if the task acknowledged the cancellation request on its already signaled CancellationToken by throwing an that bears the same .

  Gets whether this instance has completed execution due to being canceled.

- Property
  4.0.0.0
  System.Boolean To be added.

  will return true when the task is in one of the three final states: , , or .

  Gets whether this has completed.

- Property
  4.0.0.0
  System.Boolean To be added.

  If is true, the task's will be equal to , and its property will be non-null.

  Gets whether the completed due to an unhandled exception.

- Method
  4.0.0.0
  System.Threading.Tasks.Task ``

  The method is a simpler alternative to the method. It creates a task with the following default values:

  Its cancellation token is .

  Its property value is .

  It uses the default task scheduler.

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

  A task that represents the work queued to execute in the ThreadPool.

  The work to execute asynchronously
- Method
  4.0.0.0
  System.Threading.Tasks.Task `` To be added.

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

  A task that represents a proxy for the task returned by .

  The work to execute asynchronously
- Method
  4.0.0.0
  System.Threading.Tasks.Task `` ``

  The method is a simpler alternative to the method. It creates a task with the following default values:

  Its property value is .

  It uses the default task scheduler.

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

  A task that represents the work queued to execute in the ThreadPool.

  The work to execute asynchronously A cancellation token that should be used to cancel the work
- Method
  4.0.0.0
  System.Threading.Tasks.Task `` `` To be added.

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

  A task that represents a proxy for the task returned by .

  The work to execute asynchronously A cancellation token that should be used to cancel the work
- Method
  4.0.0.0
  System.Threading.Tasks.Task<TResult> `` To be added.

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

  A Task(TResult) that represents a proxy for the Task(TResult) returned by .

  The work to execute asynchronously The type of the result returned by the proxy task.
- Method
  4.0.0.0
  System.Threading.Tasks.Task<TResult> ``

  The method is a simpler alternative to the method. It creates a task with the following default values:

  Its cancellation token is .

  Its property value is .

  It uses the default task scheduler.

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

  A Task(TResult) that represents the work queued to execute in the ThreadPool.

  The work to execute asynchronously The result type of the task.
- Method
  4.0.0.0
  System.Threading.Tasks.Task<TResult> `` `` To be added.

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

  A Task(TResult) that represents a proxy for the Task(TResult) returned by .

  The work to execute asynchronously A cancellation token that should be used to cancel the work The type of the result returned by the proxy task.
- Method
  4.0.0.0
  System.Threading.Tasks.Task<TResult> `` ``

  The method is a simpler alternative to the method. It creates a task with the following default values:

  Its property value is .

  It uses the default task scheduler.

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

  A Task(TResult) that represents the work queued to execute in the ThreadPool.

  The work to execute asynchronously A cancellation token that should be used to cancel the work The result type of the task.
- Method
  4.0.0.0
  System.Void

  A task may only be started and run only once. Any attempts to schedule a task a second time will result in an exception.

  Tasks executed with will be associated with the current .

  If the target scheduler does not support running this task on the current thread, the task will be scheduled for execution on the scheduler, and the current thread will block until the task has completed execution.

  Runs the synchronously on the current .

- Method
  4.0.0.0
  System.Void ``

  A task may only be started and run only once. Any attempts to schedule a task a second time will result in an exception.

  If the target scheduler does not support running this task on the current thread, the task will be scheduled for execution on the scheduler, and the current thread will block until the task has completed execution.

  Runs the synchronously on the provided.

  The scheduler on which to attempt to run this task inline.
- Method
  4.0.0.0
  System.Void

  A task may only be started and run only once. Any attempts to schedule a task a second time will result in an exception.

  Starts the , scheduling it for execution to the current .

- Method
  4.0.0.0
  System.Void ``

  A task may only be started and run only once. Any attempts to schedule a task a second time will result in an exception.

  Starts the , scheduling it for execution to the specified .

  The with which to associate and execute this task.
- Property
  4.0.0.0
  System.Threading.Tasks.TaskStatus To be added.

  For more information and an example, see How to: Chain Multiple Tasks with Continuations and How to: Cancel a Task and Its Children.

  Gets the of this task.

- Property
  4.0.0.0
  System.Threading.WaitHandle To be added.

  Using the wait functionality provided by should be preferred over using for similar functionality. For more information, see How to: Wait on One or More Tasks to Complete and TPL With Other Asynchronous Patterns.

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

- Property
  4.0.0.0
  System.Boolean To be added. To be added.

  Gets an indication of whether the operation completed synchronously.

- Method
  4.0.0.0
  System.Void

  For more information and an example, see How to: Wait on One or More Tasks to Complete.

  Waits for the to complete execution.

- Method
  4.0.0.0
  System.Boolean `` To be added.

  Waits for the to complete execution within a specified number of milliseconds.

  true if the completed execution within the allotted time; otherwise, false.

  The number of milliseconds to wait, or (-1) to wait indefinitely.
- Method
  4.0.0.0
  System.Void `` To be added.

  Waits for the cancellable to complete execution.

  A to observe while waiting for the task to complete.
- Method
  4.0.0.0
  System.Boolean `` To be added.

  Waits for the to complete execution within a specified time interval.

  true if the completed execution within the allotted time; otherwise, false.

  A that represents the number of milliseconds to wait, or a that represents -1 milliseconds to wait indefinitely.
- Method
  4.0.0.0
  System.Boolean `` `` To be added.

  Waits for the cancellable to complete execution.

  true if the completed execution within the allotted time; otherwise, false.

  The number of milliseconds to wait, or (-1) to wait indefinitely. A to observe while waiting for the task to complete.
- Method
  4.0.0.0
  System.Void `System.ParamArray` To be added.

  Waits for all of the provided objects to complete execution.

  An array of instances on which to wait.
- Method
  4.0.0.0
  System.Boolean `` `` To be added.

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

  true if all of the instances completed execution within the allotted time; otherwise, false.

  An array of instances on which to wait. The number of milliseconds to wait, or (-1) to wait indefinitely.
- Method
  4.0.0.0
  System.Void `` ``

  The argument is used to cancel the wait operation. If it is canceled, the Wait returns false (False in Visual Basic). Cancellation of the tasks is a distinct operation, and is signaled by the AggregateException as noted above.

  Waits for all of the provided cancellable objects to complete execution.

  An array of instances on which to wait. A to observe while waiting for the tasks to complete.
- Method
  4.0.0.0
  System.Boolean `` ``

  The argument is used to cancel the wait operation. If it is canceled, the Wait returns false (False in Visual Basic). Cancellation of the tasks is a distinct operation, and is signaled by the AggregateException as noted above.

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

  true if all of the instances completed execution within the allotted time; otherwise, false.

  An array of instances on which to wait. A that represents the number of milliseconds to wait, or a that represents -1 milliseconds to wait indefinitely.
- Method
  4.0.0.0
  System.Boolean `` `` ``

  The argument is used to cancel the wait operation. If it is canceled, the Wait returns false (False in Visual Basic). Cancellation of the tasks is a distinct operation, and is signaled by the AggregateException as noted above.

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

  true if all of the instances completed execution within the allotted time; otherwise, false.

  An array of instances on which to wait. The number of milliseconds to wait, or (-1) to wait indefinitely. A to observe while waiting for the tasks to complete.
- Method
  4.0.0.0
  System.Int32 `System.ParamArray` To be added.

  Waits for any of the provided objects to complete execution.

  The index of the completed task in the array argument.

  An array of instances on which to wait.
- Method
  4.0.0.0
  System.Int32 `` `` To be added.

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

  The index of the completed task in the array argument, or -1 if the timeout occurred.

  An array of instances on which to wait. The number of milliseconds to wait, or (-1) to wait indefinitely.
- Method
  4.0.0.0
  System.Int32 `` `` To be added.

  Waits for any of the provided cancellable objects to complete execution.

  The index of the completed task in the array argument.

  An array of instances on which to wait. A to observe while waiting for a task to complete.
- Method
  4.0.0.0
  System.Int32 `` `` To be added.

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

  The index of the completed task in the array argument, or -1 if the timeout occurred.

  An array of instances on which to wait. A that represents the number of milliseconds to wait, or a that represents -1 milliseconds to wait indefinitely.
- Method
  4.0.0.0
  System.Int32 `` `` `` To be added.

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

  The index of the completed task in the array argument, or -1 if the timeout occurred.

  An array of instances on which to wait. The number of milliseconds to wait, or (-1) to wait indefinitely. A to observe while waiting for a task to complete.
- Method
  4.0.0.0
  System.Threading.Tasks.Task ``

  If any of the supplied tasks completes in a faulted state, the returned task will also complete in a Faulted state, where its exceptions will contain the aggregation of the set of unwrapped exceptions from each of the supplied tasks.

  If none of the supplied tasks faulted but at least one of them was canceled, the returned task will end in the Canceled state.

  If none of the tasks faulted and none of the tasks were canceled, the resulting task will end in the RanToCompletion state.

  If the supplied array/enumerable contains no tasks, the returned task will immediately transition to a RanToCompletion state before it's returned to the caller.

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

  A task that represents the completion of all of the supplied tasks.

  The tasks to wait on for completion.
- Method
  4.0.0.0
  System.Threading.Tasks.Task `System.ParamArray`

  If any of the supplied tasks completes in a faulted state, the returned task will also complete in a Faulted state, where its exceptions will contain the aggregation of the set of unwrapped exceptions from each of the supplied tasks.

  If none of the supplied tasks faulted but at least one of them was canceled, the returned task will end in the Canceled state.

  If none of the tasks faulted and none of the tasks were canceled, the resulting task will end in the RanToCompletion state.

  If the supplied array/enumerable contains no tasks, the returned task will immediately transition to a RanToCompletion state before it's returned to the caller.

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

  A task that represents the completion of all of the supplied tasks.

  The tasks to wait on for completion.
- Method
  4.0.0.0
  System.Threading.Tasks.Task<TResult[]> ``

  If any of the supplied tasks completes in a faulted state, the returned task will also complete in a Faulted state, where its exceptions will contain the aggregation of the set of unwrapped exceptions from each of the supplied tasks.

  If none of the supplied tasks faulted but at least one of them was canceled, the returned task will end in the Canceled state.

  If none of the tasks faulted and none of the tasks were canceled, the resulting task will end in the RanToCompletion state. The Result of the returned task will be set to an array containing all of the results of the supplied tasks in the same order as they were provided (e.g. if the input tasks array contained t1, t2, t3, the output task's Result will return an TResult[] where arr[0] == t1.Result, arr[1] == t2.Result, and arr[2] == t3.Result).

  If the supplied array/enumerable contains no tasks, the returned task will immediately transition to a RanToCompletion state before it's returned to the caller. The returned TResult[] will be an array of 0 elements.

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

  A task that represents the completion of all of the supplied tasks.

  The tasks to wait on for completion. The type of the completed task.
- Method
  4.0.0.0
  System.Threading.Tasks.Task<TResult[]> `System.ParamArray`

  If any of the supplied tasks completes in a faulted state, the returned task will also complete in a Faulted state, where its exceptions will contain the aggregation of the set of unwrapped exceptions from each of the supplied tasks.

  If none of the supplied tasks faulted but at least one of them was canceled, the returned task will end in the Canceled state.

  If none of the tasks faulted and none of the tasks were canceled, the resulting task will end in the RanToCompletion state. The Result of the returned task will be set to an array containing all of the results of the supplied tasks in the same order as they were provided (e.g. if the input tasks array contained t1, t2, t3, the output task's Result will return an TResult[] where arr[0] == t1.Result, arr[1] == t2.Result, and arr[2] == t3.Result).

  If the supplied array/enumerable contains no tasks, the returned task will immediately transition to a RanToCompletion state before it's returned to the caller. The returned TResult[] will be an array of 0 elements.

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

  A task that represents the completion of all of the supplied tasks.

  The tasks to wait on for completion. The type of the completed task.
- Method
  4.0.0.0
  System.Threading.Tasks.Task<System.Threading.Tasks.Task> ``

  The returned task will complete when any of the supplied tasks has completed. The returned task will always end in the RanToCompletion state with its Result set to the first task to complete. This is true even if the first task to complete ended in the Canceled or Faulted state.

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

  A task that represents the completion of one of the supplied tasks. The return task's Result is the task that completed.

  The tasks to wait on for completion.
- Method
  4.0.0.0
  System.Threading.Tasks.Task<System.Threading.Tasks.Task> `System.ParamArray`

  The returned task will complete when any of the supplied tasks has completed. The returned task will always end in the RanToCompletion state with its Result set to the first task to complete. This is true even if the first task to complete ended in the Canceled or Faulted state.

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

  A task that represents the completion of one of the supplied tasks. The return task's Result is the task that completed.

  The tasks to wait on for completion.
- Method
  4.0.0.0
  System.Threading.Tasks.Task<System.Threading.Tasks.Task<TResult>> ``

  The returned task will complete when any of the supplied tasks has completed. The returned task will always end in the RanToCompletion state with its Result set to the first task to complete. This is true even if the first task to complete ended in the Canceled or Faulted state.

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

  A task that represents the completion of one of the supplied tasks. The return task's Result is the task that completed.

  The tasks to wait on for completion. The type of the completed task.
- Method
  4.0.0.0
  System.Threading.Tasks.Task<System.Threading.Tasks.Task<TResult>> `System.ParamArray`

  The returned task will complete when any of the supplied tasks has completed. The returned task will always end in the RanToCompletion state with its Result set to the first task to complete. This is true even if the first task to complete ended in the Canceled or Faulted state.

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

  A task that represents the completion of one of the supplied tasks. The return task's Result is the task that completed.

  The tasks to wait on for completion. The type of the completed task.
- Method
  4.0.0.0
  System.Runtime.CompilerServices.YieldAwaitable

  You can use await Task.Yield(); in an asynchronous method to force the method to complete asynchronously. If there is a current synchronization context ( object), this will post the remainder of the method’s execution back to that context. However, the context will decide how to prioritize this work relative to other work that may be pending. The synchronization context that is present on a UI thread in most UI environments will often prioritize work posted to the context higher than input and rendering work. For this reason, do not rely on await Task.Yield(); to keep a UI responsive. For more information, see the entry Useful Abstractions Enabled with ContinueWith in the Parallel Programming with .NET blog.

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

  A context that, when awaited, will asynchronously transition back into the current context at the time of the await. If the current is non-null, it is treated as the current context. Otherwise, the task scheduler that is associated with the currently executing task is treated as the current context.