Skip to content

Applies to

netstandard2.0

Overloads

  • 1. public CompositeDisposable()
  • 2. public CompositeDisposable(int capacity)
  • 3. public CompositeDisposable(params IDisposable[] disposables)
  • 4. public CompositeDisposable(IEnumerable<IDisposable> disposables)

1. Overload

public CompositeDisposable()

Summary: Initializes a new instance of the CompositeDisposable class with no disposables contained by it initially.

2. Overload

public CompositeDisposable(int capacity)

Summary: Initializes a new instance of the CompositeDisposable class with the specified number of disposables.

Parameters

NameTypeDescription
capacityintThe number of disposables that the new CompositeDisposable can initially store.

Exceptions

TypeCondition
System.ArgumentOutOfRangeExceptioncapacity is less than zero.

3. Overload

public CompositeDisposable(params IDisposable[] disposables)

Summary: Initializes a new instance of the CompositeDisposable class from a group of disposables.

Parameters

NameTypeDescription
params disposablesIDisposable[]Disposables that will be disposed together.

Exceptions

TypeCondition
System.ArgumentNullExceptiondisposables is null.
System.ArgumentExceptionAny of the disposables in the disposables collection is null.

4. Overload

public CompositeDisposable(IEnumerable<IDisposable> disposables)

Summary: Initializes a new instance of the CompositeDisposable class from a group of disposables.

Parameters

NameTypeDescription
disposablesIEnumerableDisposables that will be disposed together.

Exceptions

TypeCondition
System.ArgumentNullExceptiondisposables is null.
System.ArgumentExceptionAny of the disposables in the disposables collection is null.