This topic has not yet been rated - Rate this topic

CancellationTokenSource Constructor (Int32)

May 02, 2013

Constructs a CancellationTokenSource that will be canceled after a specified time span.

Namespace:  System.Threading
Assembly:  mscorlib (in mscorlib.dll)
public CancellationTokenSource(
	int millisecondsDelay
)

Parameters

millisecondsDelay
Type: System.Int32
The time span to wait before canceling this CancellationTokenSource.
ExceptionCondition
ArgumentOutOfRangeException

The exception that is thrown when millisecondsDelay is less than -1.

The countdown for the millisecondsDelay starts during the call to the constructor. When the millisecondsDelay expires, the constructed CancellationTokenSource is canceled (if it has not been canceled already).

Subsequent calls to CancelAfter will reset the millisecondsDelay for the constructed CancellationTokenSource, if it has not been canceled already.

Windows Phone OS

Supported in: 8.0

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.