|
namespace MegaMappingway;
|
|
|
|
internal class OnDispose : IDisposable {
|
|
private Action Action { get; }
|
|
|
|
private bool _disposed;
|
|
|
|
internal OnDispose(Action action) {
|
|
this.Action = action;
|
|
}
|
|
|
|
public void Dispose() {
|
|
if (this._disposed) {
|
|
return;
|
|
}
|
|
|
|
this._disposed = true;
|
|
this.Action();
|
|
}
|
|
}
|