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

CancellationTokenSource.CancelAfter Method (Int32)

[ 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)

'Declaration
Public Sub CancelAfter ( _
	millisecondsDelay As Integer _
)

Parameters

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

ExceptionCondition
ObjectDisposedException

The exception thrown when this CancellationTokenSource has been disposed.

ArgumentOutOfRangeException

The exception thrown when millisecondsDelay is less than -1.

The countdown for the millisecondsDelay starts during this call. When the millisecondsDelay expires, this CancellationTokenSource is canceled, if it has not been canceled already.

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

Windows Phone OS

Supported in: 8.1, 8.0

Show:
© 2017 Microsoft