CancellationTokenSource.CreateLinkedTokenSource Method (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
Assembly:  mscorlib (in mscorlib.dll)

public static CancellationTokenSource CreateLinkedTokenSource(
	params CancellationToken[] tokens
)

Parameters

tokens
Type: 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 null.

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
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft