public TestClass() { DisposeService = new DisposeService <TestClass>(this, ps => { if (_handle != null) { _handle.Dispose(); } }); _handle = new SafeFileHandle(IntPtr.Zero, true); }
public TestClass() { DisposeService = new DisposeService <TestClass>(this, ps => { if (_handle != null) { _handle.Dispose(); } }, ps => { /* Free unmanaged resources here */ }); _handle = new SafeFileHandle(IntPtr.Zero, true); }
protected OperationBase(bool canRun, TimeSpan duration, int runOrderId) { CanRun = canRun; Duration = duration; RunOrderId = runOrderId; _logger = Program.Logger; DisposeService = new DisposeService <OperationBase>(this, ps => { if (Process == null) { return; } DestroyProcess(); }); }