CancellationTokenSource.CancelAfter Method (TimeSpan)

May 11, 2014

Schedules a Cancel operation on this CancellationTokenSource.

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

public void CancelAfter(
	TimeSpan delay
)

Parameters

delay
Type: System.TimeSpan
The time span to wait before canceling this CancellationTokenSource.

ExceptionCondition
ObjectDisposedException

The exception thrown when this CancellationTokenSource has been disposed.

ArgumentOutOfRangeException

The exception that is thrown when delay is less than -1 or greater than Int32.MaxValue.

Windows Phone OS

Supported in: 8.1, 8.0

Show:
© 2014 Microsoft