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.
Assembly: mscorlib (in mscorlib.dll)
Parameters
- millisecondsDelay
- Type: System.Int32
The time span to wait before canceling this CancellationTokenSource.
| Exception | Condition |
|---|---|
| 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.