TaskAsyncEnumerableExtensions.WithCancellation<T> Methode

Definitie

Hiermee stelt u in dat het CancellationToken moet worden doorgegeven GetAsyncEnumerator(CancellationToken) bij het herhalen.

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static System::Runtime::CompilerServices::ConfiguredCancelableAsyncEnumerable<T> WithCancellation(System::Collections::Generic::IAsyncEnumerable<T> ^ source, System::Threading::CancellationToken cancellationToken);
public static System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable<T> WithCancellation<T>(this System.Collections.Generic.IAsyncEnumerable<T> source, System.Threading.CancellationToken cancellationToken) where T : allows ref struct;
public static System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable<T> WithCancellation<T>(this System.Collections.Generic.IAsyncEnumerable<T> source, System.Threading.CancellationToken cancellationToken);
static member WithCancellation : System.Collections.Generic.IAsyncEnumerable<'T> * System.Threading.CancellationToken -> System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable<'T>
<Extension()>
Public Function WithCancellation(Of T) (source As IAsyncEnumerable(Of T), cancellationToken As CancellationToken) As ConfiguredCancelableAsyncEnumerable(Of T)

Type parameters

T

Het type objecten dat wordt ge curseerd.

Parameters

source
IAsyncEnumerable<T>

De bron die kan worden geïnventariseerd.

cancellationToken
CancellationToken

De CancellationToken te gebruiken.

Retouren

De geconfigureerde opsomming.

Van toepassing op