BackgroundWorker.CancellationPending Property

Gets a value indicating whether the application has requested cancellation of a background operation.

Namespace:  System.ComponentModel
Assemblies:   System.ComponentModel.EventBasedAsync (in System.ComponentModel.EventBasedAsync.dll)
  System (in System.dll)

member CancellationPending : bool with get

Property Value

Type: System.Boolean
true if the application has requested cancellation of a background operation; otherwise, false. The default is false.

If CancellationPending is true, then the CancelAsync method has been called on the BackgroundWorker.

This property is meant for use by the worker thread, which should periodically check CancellationPending and abort the background operation when it is set to true.

The following code example demonstrates the use of the CancellationPending property to query a BackgroundWorker about its cancellation state. This code example is part of a larger example provided for the BackgroundWorker class.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Supported in: Windows Phone 8.1

Supported in: Windows Phone Silverlight 8.1

Supported in: Windows Phone Silverlight 8
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft