Skip to content

RefCountDisposable(IDisposable) constructor

Defined in

Type: RefCountDisposable Namespace: System.Reactive.Disposables Assembly: System.Reactive.dll

Applies to

netstandard2.0

Overloads

  • 1. public RefCountDisposable(IDisposable disposable)
  • 2. public RefCountDisposable(IDisposable disposable, bool throwWhenDisposed)

1. Overload

public RefCountDisposable(IDisposable disposable)

Summary: Initializes a new instance of the RefCountDisposable class with the specified disposable.

Parameters

NameTypeDescription
disposableIDisposableUnderlying disposable.

Exceptions

TypeCondition
System.ArgumentNullExceptiondisposable is null.

2. Overload

public RefCountDisposable(IDisposable disposable, bool throwWhenDisposed)

Summary: Initializes a new instance of the RefCountDisposable class with the specified disposable.

Parameters

NameTypeDescription
disposableIDisposableUnderlying disposable.
throwWhenDisposedboolIndicates whether subsequent calls to [GetDisposable](# should throw when this instance is disposed.

Exceptions

TypeCondition
System.ArgumentNullExceptiondisposable is null.