s&
newspaper
About
info
About s&box
newspaper
Latest News
published_with_changes
Changes
map
Roadmap
monitoring
Metrics
games
Games
sports_esports
Browse Games
rocket
Discover Games
business_center
Workshop
sports_esports
Games
landscape
Maps
chair
Models
texture
Materials
apparel
Clothing
construction
More..
forum
Forum
docs
Docs
docs
Documentation
dashboard
Api Reference
school
Tutorials
input
Log in with Steam
chevron_left
Change Language
简体中文
English
Русский
Español
Português-Brasil
Deutsch
日本語
Français
Polski
Türkçe
한국어
Pirate
Italiano
ไทย
繁體中文
Українська
Čeština
Nederlands
Magyar
Dansk
Suomi
Svenska
Norsk
Ελληνικά
Română
Български
Tiếng Việt
Bahasa Indonesia
Español-Latinoamérica
العربية
Api
Classes
DisposeAction
chevron_left
Classes
struct
DisposeAction
search
Constructors
functions
DisposeAction
Methods
functions
Dispose
Static Methods
functions
Create
DisposeAction
A simple IDisposable that invokes an action when disposed. Useful for creating using-blocks with cleanup logic.
struct
Sandbox.Utility
.
sealed
Sandbox.System
Examples
using ( DisposeAction.Create( () => Console.WriteLine( "Cleanup!" ) ) ) { // Do work } // "Cleanup!" is printed here
build
Constructors
1
DisposeAction
(
action
)
Creates a new DisposeAction that will invoke the specified action on disposal.
functions
Methods
1
Dispose
(
)
Invokes the action specified in the constructor.
functions
Static Methods
1
Create
(
action
)
IDisposable
Factory method to create a DisposeAction as an IDisposable.
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.