The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
TaskCompletionSource<TResult>::TrySetCanceled Method (CancellationToken)
.NET Framework (current version)
Attempts to transition the underlying Task<TResult> into the TaskStatus::Canceled state and enables a cancellation token to be stored in the canceled task.
Assembly: mscorlib (in mscorlib.dll)
Parameters
- cancellationToken
-
Type:
System.Threading::CancellationToken
A cancellation token.
The method returns false if the underlying Task<TResult> object is already in one of the following three final states.
This method also returns false if the underlying Task<TResult> object has already been disposed.
Universal Windows Platform
Available since 10
.NET Framework
Available since 4.6
Available since 10
.NET Framework
Available since 4.6
Show: