ParallelEnumerable.WithCancellation<TSource> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Sets the CancellationToken to associate with the query.
public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
static System::Linq::ParallelQuery<TSource> ^ WithCancellation(System::Linq::ParallelQuery<TSource> ^ source, System::Threading::CancellationToken cancellationToken);
public static System.Linq.ParallelQuery<TSource> WithCancellation<TSource> (this System.Linq.ParallelQuery<TSource> source, System.Threading.CancellationToken cancellationToken);
static member WithCancellation : System.Linq.ParallelQuery<'Source> * System.Threading.CancellationToken -> System.Linq.ParallelQuery<'Source>
<Extension()>
Public Function WithCancellation(Of TSource) (source As ParallelQuery(Of TSource), cancellationToken As CancellationToken) As ParallelQuery(Of TSource)
Type Parameters
- TSource
The type of elements of source
.
Parameters
- source
- ParallelQuery<TSource>
A ParallelQuery on which to set the option.
- cancellationToken
- CancellationToken
A cancellation token.
Returns
A ParallelQuery representing the same query as source
, but with the registered cancellation token.
Exceptions
The CancellationTokenSource associated with the cancellationToken
has been disposed.
source
is a null reference (Nothing in Visual Basic).
WithCancellation<TSource>(ParallelQuery<TSource>, CancellationToken) is used multiple times in the query.
Applies to
See also
Povratne informacije
https://aka.ms/ContentUserFeedback.
Kmalu na voljo: V letu 2024 bomo ukinili storitev Težave v storitvi GitHub kot mehanizem za povratne informacije za vsebino in jo zamenjali z novim sistemom za povratne informacije. Za več informacij si oglejte:Pošlji in prikaži povratne informacije za