<PackageReference Include="ReactiveUI.Disposables" Version="7.3.0" />

ReactiveUI.Primitives.Disposables.MultipleDisposable

A disposable pocket that contains a set of disposables and disposes them together.
public int Count { get; }

Gets the number of disposables currently held. Returns zero once disposed.

public bool IsDisposed { get; }

Gets a value indicating whether the object is disposed.

public bool IsReadOnly { get; }

Gets a value indicating whether the collection is read-only. Always false.

Initializes a new instance of the MultipleDisposable class.

Initializes a new instance of the MultipleDisposable class.

Initializes a new instance of the MultipleDisposable class.

public MultipleDisposable(IDisposable[] disposables)

Initializes a new instance of the MultipleDisposable class from a group of disposables.

public static IDisposable Create(IDisposable[] disposables)

Creates a new group of disposable resources that are disposed together.

public void Add(IDisposable item)

Adds a disposable to the MultipleDisposable or disposes it immediately if the pocket is already disposed.

public void Clear()

Removes and disposes every disposable currently held without disposing the group itself.

public bool Contains(IDisposable item)

Determines whether the group currently holds the supplied disposable.

public void CopyTo(IDisposable[] array, int arrayIndex)

Copies the disposables currently held into array starting at arrayIndex.

public void Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

protected virtual void Dispose(bool disposing)

Releases unmanaged and - optionally - managed resources.

Returns an enumerator over a snapshot of the disposables currently held.

public bool Remove(IDisposable item)

Removes and disposes the requested disposable from the pocket.