API ReferenceSandbox.Utility
public sealed struct Sandbox.Utility.DisposeAction
A simple IDisposable that invokes an action when disposed. Useful for creating using-blocks with cleanup logic.
Constructors
Showing 1 constructors
public DisposeAction(System.Action action)
Creates a new DisposeAction that will invoke the specified action on disposal.
Parameters
action: The action to invoke when disposed
No results match this filter.
Methods
Showing 2 methods
public static System.IDisposable Create(System.Action action)
Factory method to create a DisposeAction as an IDisposable.
Parameters
action: The action to invoke when disposed
Returns
A disposable object that will invoke the action
public virtual sealed void Dispose()
Invokes the action specified in the constructor.
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | Sandbox.Utility |
| Type | class |
| Assembly | Sandbox.System |
| Doc ID | T:Sandbox.Utility.DisposeAction |