TaskCanceledException.Task 属性

定义

获取与此异常关联的任务。Gets the task associated with this exception.

public:
 property System::Threading::Tasks::Task ^ Task { System::Threading::Tasks::Task ^ get(); };
public System.Threading.Tasks.Task Task { get; }
member this.Task : System.Threading.Tasks.Task
Public ReadOnly Property Task As Task

属性值

对与此异常关联的 Task 的引用。A reference to the Task that is associated with this exception.

注解

允许没有任务与关联TaskCanceledException, 在这种情况下, 此属性将返回 null。It is permissible for no Task to be associated with a TaskCanceledException, in which case this property will return null.

此属性是线程安全的, 可同时从多个线程使用。This property is thread-safe and may be used from multiple threads concurrently.

适用于

另请参阅