A collection of disposable objects, disposed in reverse order when the collection is disposed.
public sealed class Disposables : IDisposable, IEnumerable
name | description |
---|---|
Disposables() | Initializes a new instance of the Disposables class. |
Disposables(…) | Initializes a new instance of the Disposables class. |
Add(…) | Adds the specified disposable. |
AddRange(…) | Adds the specified disposables. |
Dispose() | Disposes all added disposables, in reverse order. |
This class is thread-safe. Null disposables are legal and ignored. Objects cannot be added to the collection after it has been disposed. The collection cannot be enumerated.