Class AggregateDisposable
An aggregate of System.IDisposables that allows to dispose several disposables in one operation.
Inheritance
Implements
Namespace: Sartorius.SAF.Infrastructure
Assembly: Sartorius.SAF.dll
Syntax
public sealed class AggregateDisposable : IDisposable
Constructors
View SourceAggregateDisposable()
Initializes a new instance of the AggregateDisposable class.
Declaration
public AggregateDisposable()
AggregateDisposable(IEnumerable<IDisposable>)
Initializes a new instance of the AggregateDisposable class with the specified child System.IDisposables.
Declaration
public AggregateDisposable(IEnumerable<IDisposable> disposables)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.IDisposable> | disposables | An enumerable of System.IDisposable instances. |
AggregateDisposable(IDisposable[])
Initializes a new instance of the AggregateDisposable class with the specified child System.IDisposables.
Declaration
public AggregateDisposable(params IDisposable[] disposables)
Parameters
Type | Name | Description |
---|---|---|
System.IDisposable[] | disposables | An array of System.IDisposable instances. |
Methods
View SourceAdd(IDisposable)
Add an instance of System.IDisposable to the child items.
Declaration
public void Add(IDisposable disposable)
Parameters
Type | Name | Description |
---|---|---|
System.IDisposable | disposable | A instance. |
AddRange(IEnumerable<IDisposable>)
Add a range of disposables.
Declaration
public void AddRange(IEnumerable<IDisposable> disposables)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.IDisposable> | disposables | A list of disposables. |
Dispose()
Disposes all child System.IDisposables.
Declaration
public void Dispose()
Exceptions
Type | Condition |
---|---|
System.AggregateException | Thrown if more than one of the child disposables throws an exception during System.IDisposable.Dispose(). If a single child disposable throws an exception this exception gets rethrown. |