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
CancellationTokenThe first token.
other
CancellationTokenThe 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
CancellationTokenThe 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.