private void OnDisconnected(object sender, EventArgs e)
 {
     if (_stream != null)
     {
         _stream.Dispose();
     }
     Exited?.Invoke(this, null);
 }
示例#2
0
 public void Dispose()
 {
     if (_stream != null)
     {
         _stream.Dispose();
     }
     if (_process != null)
     {
         try {
             if (!_process.HasExited)
             {
                 _process.Kill();
             }
         } catch (InvalidOperationException) {
         } catch (Win32Exception) {
         }
         _process.Dispose();
     }
 }