Class RefCountDisposable
Represents a disposable resource that only disposes its underlying disposable resource when all GetDisposable() have been disposed.
Inherited Members
Namespace: System.Reactive.Disposables
Assembly: System.Reactive.Core.dll
Syntax
public sealed class RefCountDisposable : ICancelable, IDisposable
Constructors
| Improve this Doc View SourceRefCountDisposable(IDisposable)
Initializes a new instance of the RefCountDisposable class with the specified disposable.
Declaration
public RefCountDisposable(IDisposable disposable)
Parameters
| Type | Name | Description |
|---|---|---|
| IDisposable | disposable | Underlying disposable. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|
Properties
| Improve this Doc View SourceIsDisposed
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 only when all dependent disposables have been disposed.
Declaration
public void Dispose()
GetDisposable()
Returns a dependent disposable that when disposed decreases the refcount on the underlying disposable.
Declaration
public IDisposable GetDisposable()
Returns
| Type | Description |
|---|---|
| IDisposable | A dependent disposable contributing to the reference count that manages the underlying disposable's lifetime. |