初始化
This commit is contained in:
21
Common/SnowIdGenerate/DisposableAction.cs
Normal file
21
Common/SnowIdGenerate/DisposableAction.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
|
||||
namespace Snowflake
|
||||
{
|
||||
public class DisposableAction : IDisposable
|
||||
{
|
||||
readonly Action _action;
|
||||
|
||||
public DisposableAction(Action action)
|
||||
{
|
||||
if (action == null)
|
||||
throw new ArgumentNullException("action");
|
||||
_action = action;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_action();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user