// Kick off menu to launch a process. private void menuItemLaunch_Click(object sender, EventArgs e) { if (GuiExtension.Debugger.Processes.HaveActive) { // Nothing to do. Not sure how we'd ever get here because the // UI shoul dhave disabled us, but just in case ... return; } gui.LaunchProcess form = new gui.LaunchProcess(); form.ShowDialog(); // If null, then they cancelled. if (form.ProcessName == null) { return; } System.IO.Directory.SetCurrentDirectory(form.WorkingDir); string cmd = "run " + form.ProcessName + " " + form.Arguments; // We want console apps to have their own console. this.ProcessEnteredText("mo nc on"); // Run the app. this.ProcessEnteredText(cmd); }
// Kick off menu to launch a process. private void menuItemLaunch_Click(object sender, EventArgs e) { // @@ Pumping test. /* MessageBox.Show("About to test pumping"); // TEST PUMPING. STA thread is blocked in pumping wait. AutoResetEvent e2 = new AutoResetEvent(false); e2.WaitOne(); MessageBox.Show("Done testing pumping"); */ if (GuiExtension.Debugger.Processes.HaveActive) { // Nothing to do. Not sure how we'd ever get here because the // UI shoul dhave disabled us, but just in case ... return; } using (gui.LaunchProcess form = new gui.LaunchProcess()) { form.ShowDialog(); // If null, then they cancelled. if (form.ProcessName == null) { return; } System.IO.Directory.SetCurrentDirectory(form.WorkingDir); string cmd = "run " + form.ProcessName + " " + form.Arguments; // We want console apps to have their own console. // Run the app. this.AsyncProcessEnteredText("mo nc on\n" + cmd); } }