ICancelableTask.Cancel Method

Definition

Instructs the task to exit as soon as possible, or to immediately exit if Execute is invoked after this method.

C#
public void Cancel();

Remarks

Cancel() may be called at any time after the task has been instantiated, even before Execute() is called. Cancel calls may come in from any thread. The implementation of this method should not block indefinitely.

Applies to

Product Versions
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1