TaskCompletionSource<TResult>.SetFromTask(Task<TResult>) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Transitions the underlying Task<TResult> into the same completion state as the specified completedTask
.
public:
void SetFromTask(System::Threading::Tasks::Task<TResult> ^ completedTask);
public void SetFromTask (System.Threading.Tasks.Task<TResult> completedTask);
member this.SetFromTask : System.Threading.Tasks.Task<'Result> -> unit
Public Sub SetFromTask (completedTask As Task(Of TResult))
Parameters
- completedTask
- Task<TResult>
The completed task whose completion status (including result, exception, or cancellation information) should be copied to the underlying task.
Exceptions
completedTask
is null
.
completedTask
is not completed.
The underlying Task<TResult> is already in one of the three final states: RanToCompletion, Faulted, or Canceled.
Remarks
This operation will return false
if the Task<TResult> is already in one of the three final states: RanToCompletion, Faulted, or Canceled.