Adds the specified IDisposable object to disposables and returns it.
public static T DisposeWith<T>(this T disposable, Disposables disposables)
where T : IDisposable
| parameter | description |
|---|---|
| T | The type of the IDisposable object. |
| disposable | The IDisposable object. |
| disposables | A disposables that will dispose disposable when it is disposed. |
The IDisposable object that was added to disposables.