Class SingleAssignmentDisposable
Represents a disposable resource which only allows a single assignment of its underlying disposable resource. If an underlying disposable resource has already been set, future attempts to set the underlying disposable resource will throw an InvalidOperationException.
Inherited Members
Namespace: System.Reactive.Disposables
Assembly: System.Reactive.Core.dll
Syntax
public sealed class SingleAssignmentDisposable : ICancelable, IDisposable
Constructors
| Improve this Doc View SourceSingleAssignmentDisposable()
Initializes a new instance of the SingleAssignmentDisposable class.
Declaration
public SingleAssignmentDisposable()
Properties
| Improve this Doc View SourceDisposable
Gets or sets the underlying disposable. After disposal, the result of getting this property is undefined.
Declaration
public IDisposable Disposable { get; set; }
Property Value
Type | Description |
---|---|
IDisposable |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown if the SingleAssignmentDisposable has already been assigned to. |
IsDisposed
Gets a value that indicates whether the object is disposed.
Declaration
public bool IsDisposed { get; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
| Improve this Doc View SourceDispose()
Disposes the underlying disposable.
Declaration
public void Dispose()