Condividi tramite


CancellationTokenExtensions.CombineWith Method

Definition

Overloads

CombineWith(CancellationToken, CancellationToken)

Creates a new CancellationToken that is canceled when any of a set of other tokens are canceled.

CombineWith(CancellationToken, CancellationToken[])

Creates a new CancellationToken that is canceled when any of a set of other tokens are canceled.

CombineWith(CancellationToken, CancellationToken)

Creates a new CancellationToken that is canceled when any of a set of other tokens are canceled.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::VisualStudio::Threading::CancellationTokenExtensions::CombinedCancellationToken CombineWith(System::Threading::CancellationToken original, System::Threading::CancellationToken other);
public static Microsoft.VisualStudio.Threading.CancellationTokenExtensions.CombinedCancellationToken CombineWith (this System.Threading.CancellationToken original, System.Threading.CancellationToken other);
static member CombineWith : System.Threading.CancellationToken * System.Threading.CancellationToken -> Microsoft.VisualStudio.Threading.CancellationTokenExtensions.CombinedCancellationToken
<Extension()>
Public Function CombineWith (original As CancellationToken, other As CancellationToken) As CancellationTokenExtensions.CombinedCancellationToken

Parameters

original
CancellationToken

The first token.

other
CancellationToken

The second token.

Returns

A struct that contains the combined CancellationToken and a means to release memory when you're done using it.

Applies to

CombineWith(CancellationToken, CancellationToken[])

Creates a new CancellationToken that is canceled when any of a set of other tokens are canceled.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::VisualStudio::Threading::CancellationTokenExtensions::CombinedCancellationToken CombineWith(System::Threading::CancellationToken original, ... cli::array <System::Threading::CancellationToken> ^ others);
public static Microsoft.VisualStudio.Threading.CancellationTokenExtensions.CombinedCancellationToken CombineWith (this System.Threading.CancellationToken original, params System.Threading.CancellationToken[] others);
static member CombineWith : System.Threading.CancellationToken * System.Threading.CancellationToken[] -> Microsoft.VisualStudio.Threading.CancellationTokenExtensions.CombinedCancellationToken
<Extension()>
Public Function CombineWith (original As CancellationToken, ParamArray others As CancellationToken()) As CancellationTokenExtensions.CombinedCancellationToken

Parameters

original
CancellationToken

The first token.

others
CancellationToken[]

The additional tokens.

Returns

A struct that contains the combined CancellationToken and a means to release memory when you're done using it.

Applies to