Table of Contents

Class CancellationTokenExtensions

Namespace
Microsoft.VisualStudio.Threading
Assembly
Microsoft.VisualStudio.Threading.dll

Extensions to CancellationToken.

public static class CancellationTokenExtensions
Inheritance
CancellationTokenExtensions
Inherited Members

Methods

CombineWith(CancellationToken, CancellationToken)

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

public static CancellationTokenExtensions.CombinedCancellationToken CombineWith(this CancellationToken original, CancellationToken other)

Parameters

original CancellationToken

The first token.

other CancellationToken

The second token.

Returns

CancellationTokenExtensions.CombinedCancellationToken

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

CombineWith(CancellationToken, params CancellationToken[])

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

public static CancellationTokenExtensions.CombinedCancellationToken CombineWith(this CancellationToken original, params CancellationToken[] others)

Parameters

original CancellationToken

The first token.

others CancellationToken[]

The additional tokens.

Returns

CancellationTokenExtensions.CombinedCancellationToken

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