次の方法で共有


Task.IsCanceled Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets whether this Task instance has completed execution due to being canceled.

Namespace:  System.Threading.Tasks
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
Public ReadOnly Property IsCanceled As Boolean
public bool IsCanceled { get; }

Property Value

Type: System.Boolean
true if the task has completed due to being canceled; otherwise false.

Remarks

A Task will complete in Canceled state either if its CancellationToken() was marked for cancellation before the task started executing, or if the task acknowledged the cancellation request on its already signaled CancellationToken by throwing an OperationCanceledException that bears the same CancellationToken.

Version Information

Silverlight

Supported in: 5

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.