Example #1
0
 public void WaitForExit(int milliseconds)
 {
     using (ProcessWaitHandle processWaitHandle = new ProcessWaitHandle(_processHandle)) {
         if (processWaitHandle.WaitOne(milliseconds))
         {
             // This means the process exited while waiting.
             SetExitState();
         }
     }
 }
Example #2
0
        public bool WaitForExit(int milliseconds)
        {
            using (var processWaitHandle = new ProcessWaitHandle(_processHandle)) {
                if (processWaitHandle.WaitOne(milliseconds))
                {
                    // This means the process exited while waiting.
                    SetExitState();
                    return(true);
                }
            }

            return(false);
        }