Windows apps
Collapse the table of content
Expand the table of content
Information
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.

Task::FromCanceled Method (CancellationToken)

.NET Framework (current version)
 

Creates a Task that's completed due to cancellation with a specified cancellation token.

Namespace:   System.Threading.Tasks
Assembly:  mscorlib (in mscorlib.dll)

public:
static Task^ FromCanceled(
	CancellationToken cancellationToken
)

Parameters

cancellationToken
Type: System.Threading::CancellationToken

The cancellation token with which to complete the task.

Return Value

Type: System.Threading.Tasks::Task^

The canceled task.

Exception Condition
ArgumentOutOfRangeException

Cancellation has not been requested for cancellationToken; its IsCancellationRequested property is false.

Universal Windows Platform
Available since 10
.NET Framework
Available since 4.6
Return to top
Show:
© 2017 Microsoft