Beispiel #1
0
 public void Close()
 {
     if (_runner != null)
     {
         _runner.Dispose();
         _runner.OutputReceived -= OnOutputReceived;
         _runner.ErrorOccured   -= OnErrorOccured;
         _runner.Closed         -= OnClose;
         _runner = null;
     }
     _callback = null;
 }
Beispiel #2
0
        public void Close()
        {
            // If Close is called more than once, make subsequent calls a nop
            ICommandRunner runner = Interlocked.Exchange(ref _runner, null);

            if (runner != null)
            {
                runner.Dispose();
                runner.OutputReceived -= OnOutputReceived;
                runner.ErrorOccured   -= OnErrorOccured;
                runner.Closed         -= OnClose;
            }
            _callback = null;
        }
 void IDisposable.Dispose()
 {
     _commandRunner.Dispose();
 }