Disposes the specified object after executing the specified delegate.
public static void DisposeAfter<T>(this T disposable, Action action)
where T : IDisposable
parameter | description |
---|---|
T | The type of the input |
disposable | The object to dispose. |
action | The delegate to execute before disposing the object. |
Disposes the specified object after executing the specified delegate.
public static void DisposeAfter<T>(this T disposable, Action<T> action)
where T : IDisposable
parameter | description |
---|---|
T | The type of the input |
disposable | The object to dispose. |
action | The delegate to execute before disposing the object. |
Disposes the specified object after executing the specified delegate.
public static TOutput DisposeAfter<TInput, TOutput>(this TInput disposable,
Func<TInput, TOutput> action)
where TInput : IDisposable
parameter | description |
---|---|
TInput | The type of the input. |
TOutput | The type of the output. |
disposable | The object to dispose. |
action | The delegate to execute before disposing the object. |
The value returned by the delegate.
Disposes the specified object after executing the specified delegate.
public static TOutput DisposeAfter<TInput, TOutput>(this TInput disposable, Func<TOutput> action)
where TInput : IDisposable
parameter | description |
---|---|
TInput | The type of the input. |
TOutput | The type of the output. |
disposable | The object to dispose. |
action | The delegate to execute before disposing the object. |
The value returned by the delegate.