wabbajack/Wabbajack.Common/DisposableUnlockable.cs

18 lines
294 B
C#
Raw Permalink Normal View History

2021-09-27 12:42:46 +00:00
using System;
2021-10-23 16:51:17 +00:00
namespace Wabbajack.Common;
public struct DisposableUnlockable : IDisposable
2021-09-27 12:42:46 +00:00
{
2021-10-23 16:51:17 +00:00
private readonly IUnlockable _unlock;
2021-09-27 12:42:46 +00:00
2021-10-23 16:51:17 +00:00
public DisposableUnlockable(IUnlockable unlock)
{
_unlock = unlock;
}
2021-09-27 12:42:46 +00:00
2021-10-23 16:51:17 +00:00
public void Dispose()
{
_unlock.Unlock();
2021-09-27 12:42:46 +00:00
}
}