MultipleDisposable class¶
Attributes: [DebuggerDisplay("{DebuggerDisplay,nq}")]
Defined in
Namespace: ReactiveUI.Primitives.Disposables
Assembly: ReactiveUI.Disposables.dll
Full name: ReactiveUI.Primitives.Disposables.MultipleDisposable
Modifiers: public
Summary¶
A disposable pocket that contains a set of disposables and disposes them together.
Applies to
net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net462, net481
Class hierarchy
classDiagram
class MultipleDisposable
class IsDisposed {
<>
}
IsDisposed <|.. MultipleDisposable
class IDisposable {
<>
}
IDisposable <|.. MultipleDisposable
class ICollection~IDisposable~ {
<>
}
ICollection~IDisposable~ <|.. MultipleDisposable
class IEnumerable~IDisposable~ {
<>
}
IEnumerable~IDisposable~ <|.. MultipleDisposable
class IEnumerable {
<>
}
IEnumerable <|.. MultipleDisposable
Implements: IsDisposed, IDisposable, ICollection
Remarks¶
Implements ICollection over IDisposable so it can stand in for a
composite disposable: it supports collection initializers, membership queries, and
DisposeWith-style extension methods that accept an ICollection.
Constructors¶
| Name | Summary |
|---|---|
| .ctor | Initializes a new instance of the [MultipleDisposable](# class. |
Properties¶
| Name | Summary |
|---|---|
| IsDisposed | Gets a value indicating whether the object is disposed. |
| Count | Gets the number of disposables currently held. Returns zero once disposed. |
| IsReadOnly | Gets a value indicating whether the collection is read-only. Always false. |
Methods¶
| Name | Summary |
|---|---|
| static Create | Creates a new group of disposable resources that are disposed together. |
| Add | Adds a disposable to the [MultipleDisposable](# or disposes it immediately if the pocket is already disposed. |
| Remove | Removes and disposes the requested disposable from the pocket. |
| Clear | Removes and disposes every disposable currently held without disposing the group itself. |
| Contains | Determines whether the group currently holds the supplied disposable. |
| CopyTo | Copies the disposables currently held into array starting at arrayIndex. |
| GetEnumerator | Returns an enumerator over a snapshot of the disposables currently held. |
| Dispose | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. |