Show / Hide Table of Contents

Class TaskCancellationManager

A class to handle managing cancellation tokens for tasks.

Inheritance
object
TaskCancellationManager
Implements
IDisposable
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Microsoft.Internal.Studios.Aruba.Infrastructure
Assembly: Aruba.Infrastructure.dll
Syntax
public class TaskCancellationManager : IDisposable

Properties

View Source

IsTaskRunning

Gets a value indicating whether the task is currently running.

Declaration
public bool IsTaskRunning { get; }
Property Value
Type Description
bool

Methods

View Source

BeginTaskAsync(Func<CancellationToken, Task>)

Begins a new task.

Declaration
public Task BeginTaskAsync(Func<CancellationToken, Task> task)
Parameters
Type Name Description
Func<CancellationToken, Task> task

A function that represents the task to run, which returns an awaitable Task and takes a cancellation token to cancel the operation.

Returns
Type Description
Task

An awaitable task.

View Source

CancelTask()

Cancels a task if there is already one in progress.

Declaration
public void CancelTask()
View Source

CancelTaskAsync()

Cancels a task if there is already one in progress, and waits for the task to finish cancelling.

Declaration
public Task CancelTaskAsync()
Returns
Type Description
Task

A Task representing the asynchronous operation

View Source

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Declaration
public void Dispose()

Implements

IDisposable
  • View Source
In this article
Back to top Generated by DocFX