Class SerialDisposable
Represents a disposable resource whose underlying disposable resource can be replaced by another disposable resource, causing automatic disposal of the previous underlying disposable resource.
Inherited Members
Namespace: System.Reactive.Disposables
Assembly: System.Reactive.Core.dll
Syntax
public sealed class SerialDisposable : ICancelable, IDisposable
Constructors
| Improve this Doc View SourceSerialDisposable()
Initializes a new instance of the SerialDisposable class.
Declaration
public SerialDisposable()
Properties
| Improve this Doc View SourceDisposable
Gets or sets the underlying disposable.
Declaration
public IDisposable Disposable { get; set; }
Property Value
Type | Description |
---|---|
IDisposable |
Remarks
If the SerialDisposable has already been disposed, assignment to this property causes immediate disposal of the given disposable object. Assigning this property disposes the previous disposable object.
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 as well as all future replacements.
Declaration
public void Dispose()