CancelAfter Method (TimeSpan)
Collapse the table of content
Expand the table of content

CancellationTokenSource.CancelAfter Method (TimeSpan)

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

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:
© 2017 Microsoft