# Sandbox.Utility.DisposeAction

A simple IDisposable that invokes an action when disposed.
Useful for creating using-blocks with cleanup logic.

## Examples

using ( DisposeAction.Create( () => Console.WriteLine( "Cleanup!" ) ) )
{
    // Do work
} // "Cleanup!" is printed here

- Kind: struct
- Namespace: `Sandbox.Utility`
- Assembly: `Sandbox.System`
- Modifiers: sealed

## Constructors

- [`DisposeAction`](/api/Sandbox.Utility.DisposeAction/.ctor): Creates a new DisposeAction that will invoke the specified action on disposal.

## Methods

- [`Create`](/api/Sandbox.Utility.DisposeAction/Create): Factory method to create a DisposeAction as an IDisposable.
- [`Dispose`](/api/Sandbox.Utility.DisposeAction/Dispose): Invokes the action specified in the constructor.
