Search Results for

    Show / Hide Table of Contents

    Class CancellationDisposable

    Represents a disposable resource that has an associated CancellationToken that will be set to the cancellation requested state upon disposal.

    Inheritance
    Object
    CancellationDisposable
    Implements
    ICancelable
    IDisposable
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ToString()
    Object.ReferenceEquals(Object, Object)
    Namespace: System.Reactive.Disposables
    Assembly: System.Reactive.Core.dll
    Syntax
    public sealed class CancellationDisposable : ICancelable, IDisposable

    Constructors

    | Improve this Doc View Source

    CancellationDisposable()

    Initializes a new instance of the CancellationDisposable class that uses a new CancellationTokenSource.

    Declaration
    public CancellationDisposable()
    | Improve this Doc View Source

    CancellationDisposable(CancellationTokenSource)

    Initializes a new instance of the CancellationDisposable class that uses an existing CancellationTokenSource.

    Declaration
    public CancellationDisposable(CancellationTokenSource cts)
    Parameters
    Type Name Description
    CancellationTokenSource cts

    CancellationTokenSource used for cancellation.

    Exceptions
    Type Condition
    ArgumentNullException

    cts is null.

    Properties

    | Improve this Doc View Source

    IsDisposed

    Gets a value that indicates whether the object is disposed.

    Declaration
    public bool IsDisposed { get; }
    Property Value
    Type Description
    Boolean
    | Improve this Doc View Source

    Token

    Gets the CancellationToken used by this CancellationDisposable.

    Declaration
    public CancellationToken Token { get; }
    Property Value
    Type Description
    CancellationToken

    Methods

    | Improve this Doc View Source

    Dispose()

    Cancels the underlying CancellationTokenSource.

    Declaration
    public void Dispose()

    Implements

    ICancelable
    System.IDisposable
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX