private void StartProcess() { if (config.Program.Exec != null) { p = new ProcessPipe(config.Program.Exec, config.Program.Args); p.onOutRecv += new ProcessPipe.RecvHandler(PutChar); p.onErrRecv += new ProcessPipe.RecvHandler(PutChar); if (p.Start()) { term.PutString(config.Program.Exec + " Started.\n\r"); p.Exited += new EventHandler(ProcessExited); } else { term.PutString(config.Program.Exec + " Start failed.\n\r"); p = null; } } }
void ProcessExited(object sender, EventArgs e) { term.PutString(config.Program.Exec + " Exited.\n\r"); p = null; }