API ReferenceSandbox.Utility
DisposeActionclass
A simple IDisposable that invokes an action when disposed. Useful for creating using-blocks with cleanup logic.
object→DisposeAction
Constructors1
Showing 1 constructors
public DisposeAction(System.Action action)
Creates a new DisposeAction that will invoke the specified action on disposal.
| Parameter | Type | Description |
|---|---|---|
| action | Action | The action to invoke when disposed |
No results match this filter.
Methods2
Showing 2 methods
public static System.IDisposable Create(System.Action action)
Factory method to create a DisposeAction as an IDisposable.
| Parameter | Type | Description |
|---|---|---|
| action | Action | The action to invoke when disposed |
Returns:
IDisposableA disposable object that will invoke the actionpublic virtual sealed void Dispose()
Invokes the action specified in the constructor.
Returns:
void—No results match this filter.