Share via


CancellationDisposable Class

Represents an IDisposable that can be checked for cancellation status.

Inheritance Hierarchy

System.Object
  System.Reactive.Disposables.CancellationDisposable

Namespace:  System.Reactive.Disposables
Assembly:  System.Reactive (in System.Reactive.dll)

Syntax

'Declaration
Public NotInheritable Class CancellationDisposable _
    Implements IDisposable
'Usage
Dim instance As CancellationDisposable
public sealed class CancellationDisposable : IDisposable
public ref class CancellationDisposable sealed : IDisposable
[<SealedAttribute>]
type CancellationDisposable =  
    class
        interface IDisposable
    end
public final class CancellationDisposable implements IDisposable

The CancellationDisposable type exposes the following members.

Constructors

  Name Description
Public method CancellationDisposable() Initializes a new instance of the CancellationDisposable class that uses a new CancellationTokenSource.
Public method CancellationDisposable(CancellationTokenSource) Initializes a new instance of the CancellationDisposable class that uses an existing CancellationTokenSource.

Top

Properties

  Name Description
Public property IsDisposed Gets a value that indicates whether the object is disposed.
Public property Token Gets the CancellationToken used by this CancellationDisposable.

Top

Methods

  Name Description
Public method Dispose Cancels the CancellationTokenSource.
Public method Equals (Inherited from Object.)
Protected method Finalize (Inherited from Object.)
Public method GetHashCode (Inherited from Object.)
Public method GetType (Inherited from Object.)
Protected method MemberwiseClone (Inherited from Object.)
Public method ToString (Inherited from Object.)

Top

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

System.Reactive.Disposables Namespace