Task<TResult>::ContinueWith Method (Action<Task<TResult>^, Object^>^, Object^)
Creates a continuation that that is passed state information and that executes when the target Task<TResult> completes.
Assembly: mscorlib (in mscorlib.dll)
public: Task^ ContinueWith( Action<Task<TResult>^, Object^>^ continuationAction, Object^ state )
An action to run when the Task<TResult> completes. When run, the delegate is passed the completed task and the caller-supplied state object as arguments.
An object representing data to be used by the continuation action.
The returned Task 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.
The following example creates a task that is passed an integer between 2 and 20 and returns an array that contains the first ten exponents (from n1 to n10) of that number. A continuation task is then responsible for displaying the exponents. It is passed both the antecedent and the original number whose exponents the antecedent generates.
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