共用方式為


ConfiguredCancelableAsyncEnumerable<T>.WithCancellation 方法

定義

設定反覆運算時要傳遞至 GetAsyncEnumerator(CancellationToken)CancellationToken

public:
 System::Runtime::CompilerServices::ConfiguredCancelableAsyncEnumerable<T> WithCancellation(System::Threading::CancellationToken cancellationToken);
public System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable<T> WithCancellation (System.Threading.CancellationToken cancellationToken);
member this.WithCancellation : System.Threading.CancellationToken -> System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable<'T>
Public Function WithCancellation (cancellationToken As CancellationToken) As ConfiguredCancelableAsyncEnumerable(Of T)

參數

cancellationToken
CancellationToken

要使用的 CancellationToken

傳回

已設定的可列舉。

備註

這會取代此反覆運算 WithCancellation(CancellationToken) 所設定的任何先前 CancellationToken

適用於