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

ReactiveUI.Primitives.Disposables.Pocket

Primitives alias for a group of disposables that are disposed together.
public int Count { get; }

Gets the number of held disposables, or zero after disposal.

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, which is always false.

public Pocket()

Initializes a new instance of the Pocket class.

public Pocket(IDisposable first, IDisposable second)

Initializes a new instance of the Pocket class.

public Pocket(IDisposable first, IDisposable second, IDisposable third)

Initializes a new instance of the Pocket class.

public Pocket(IDisposable[] disposables)

Initializes a new instance of the Pocket class.

public void Add(IDisposable item)

Adds a disposable to the pocket, or disposes it immediately when the pocket is disposed.

public void Clear()

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

public bool Contains(IDisposable item)

Determines whether the pocket 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()

Disposes every held disposable and marks the pocket disposed; repeated calls have no further effect.

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.