/// <summary> /// This method is called in the context of the UI thread when the /// worker thread has completed. /// </summary> public void OnCompletion(int exitCode) { m_thread = null; // The caller has already terminated the process. Bail out. if (!m_runningFlag) return; m_runningFlag = false; if (ProcessEnd != null) ProcessEnd(this, new ProcEndEventArgs(exitCode)); }
/// <summary> /// Start the process. /// </summary> public void Start() { Debug.Assert(m_runningFlag == false); ProcessInfo = new KSyscalls.PROCESS_INFORMATION(); CreateProcess(null, CommandLine, InheritHandles, CreationFlags, ref StartupInfo, out ProcessInfo); m_runningFlag = true; m_thread = new KProcessThread(this); m_thread.Start(); }