Exemplo n.º 1
0
 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);
 }
Exemplo n.º 3
0
        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();
            });
        }