Created
June 30, 2016 02:42
-
-
Save melvinlee/4eff018ba5cf7450fe1acd6e9e0d69c2 to your computer and use it in GitHub Desktop.
Disposable Action
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal class DisposableAction : IDisposable | |
{ | |
private readonly Action _action; | |
public DisposableAction(Action action) | |
{ | |
_action = action; | |
} | |
public void Dispose() | |
{ | |
_action?.Invoke(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment