Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

CancellationTokenSource::CreateLinkedTokenSource Method (array<CancellationToken>)

Creates a CancellationTokenSource that will be in the canceled state when any of the source tokens in the specified array are in the canceled state.

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

public:
static CancellationTokenSource^ CreateLinkedTokenSource(
	... array<CancellationToken>^ tokens
)

Parameters

tokens
Type: array<System.Threading::CancellationToken>

An array that contains the cancellation token instances to observe.

Return Value

Type: System.Threading::CancellationTokenSource
A CancellationTokenSource that is linked to the source tokens.

ExceptionCondition
ObjectDisposedException

A CancellationTokenSource associated with one of the source tokens has been disposed.

ArgumentNullException

tokens is nullptr.

ArgumentException

tokens is empty.

.NET Framework

Supported in: 4.6, 4.5, 4

.NET Framework Client Profile

Supported in: 4

Portable Class Library

Supported in: Portable Class Library

Supported in: Windows Phone 8.1

Supported in: Windows Phone Silverlight 8.1

Supported in: Windows Phone Silverlight 8
Show:
© 2015 Microsoft