Task.ContinueWith Method (Action(Of Task, Object), Object, CancellationToken, TaskContinuationOptions, TaskScheduler)
Creates a continuation that receives caller-supplied state information and a cancellation token and that executes when the target Task completes. The continuation executes based on a set of specified conditions and uses a specified scheduler.
Assembly: mscorlib (in mscorlib.dll)
Public Function ContinueWith ( continuationAction As Action(Of Task, Object), state As Object, cancellationToken As CancellationToken, continuationOptions As TaskContinuationOptions, scheduler As TaskScheduler ) As Task
System.Action(Of Task, Object)
An action to run when the Task 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 CancellationToken that will be assigned to the new continuation task.
- Type: System.Threading.Tasks.TaskContinuationOptions
The continuationAction argument is null.
The continuationOptions argument specifies an invalid value for TaskContinuationOptions.
The scheduler argument is null.
The provided CancellationToken has already been disposed.
The returned Task will not be scheduled for execution until the current task has completed. If the criteria specified through the continuationOptions parameter are not met, the continuation task will be canceled instead of scheduled.
Available since 8
Available since 4.5
Portable Class Library
Supported in: portable .NET platforms
Windows Phone Silverlight
Available since 8.0
Available since 8.1