Share via


SingleAssignmentDisposable Class

A SingleAssignmentDisposable only allows a single assignment of its disposable object. If it has already been assigned, attempts to set the underlying object will throw an InvalidOperationException.

Inheritance Hierarchy

System.Object
  System.Reactive.Disposables.SingleAssignmentDisposable

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

Syntax

'Declaration
Public Class SingleAssignmentDisposable _
    Implements IDisposable
'Usage
Dim instance As SingleAssignmentDisposable
public class SingleAssignmentDisposable : IDisposable
public ref class SingleAssignmentDisposable : IDisposable
type SingleAssignmentDisposable =  
    class
        interface IDisposable
    end
public class SingleAssignmentDisposable implements IDisposable

The SingleAssignmentDisposable type exposes the following members.

Constructors

  Name Description
Public method SingleAssignmentDisposable Initializes a new instance if the SingleAssignmentDisposable class.

Top

Properties

  Name Description
Public property Disposable Gets or sets the underlying disposable.
Public property IsDisposed Gets a value indicating whether the object is disposed.

Top

Methods

  Name Description
Public method Dispose Disposes the underlying disposable.
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