private void AppendTextInBox(RichTextBox box, string text) { if (this.InvokeRequired) { this.Invoke((Action <RichTextBox, string>)AppendTextInBox, ConsoleView.TextBox(), text); } else { box.Text += text; } }
private void compilerWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (process.ExitCode == 0) { //string output = process.StandardOutput.ReadToEnd(); //consoleBox.Text = ""; //ConsoleView.SetText("", false); ConsoleView.TextBox().Text = ""; //pnlBottom.BackColor = Color.Green; //bottomPanel.BackColor = Color.Green; // green 008000 setBottomBackColor("#008000", "#50cf50"); showConsolePanel(); //Form1.displayConsolePanel(); //Form1.SetCompileStatus("Compiled"); runWorker.RunWorkerAsync(); //MessageBox.Show("a: " + a + " out: "+ output); } else { //MessageBox.Show("error"); //setCompileStatus("Compile Error"); //Form1.SetCompileStatus("Compile Error"); string output = process.StandardError.ReadToEnd(); string error = CompileErrors(output); //Console.WriteLine("er" + error); int errNum; bool num = Int32.TryParse(error, out errNum); //problemsBox.Text = output; //problemsBox.SelectionStart = problemsBox.Text.Length; //problemsBox.ScrollToCaret(); //bottomPanel.BackColor = Color.Red; setBottomBackColor("#ff0000", "#f72929"); //Form1.displayProblemsPanel(); showProblemsPanel(); ProblemsView.TextBox().Text = output; ProblemsView.TextBox().SelectionStart = ProblemsView.TextBox().Text.Length; ProblemsView.TextBox().ScrollToCaret(); //ProblemsView; if (num) { //lblProblems.Text = "PROBLEMS " + errNum; } else { //lblProblems.Text = "PROBLEMS -TOO MANY!"; } //pnlBottom.BackColor = Color.Red; //showProblemsPanel(); //Form1.displayProblemsPanel(true); //MessageBox.Show("a: " + a + " out: " + output); } }
private void InterProcOutputHandler(object sendingProcess, DataReceivedEventArgs outLine) { AppendTextInBox(ConsoleView.TextBox(), outLine.Data + Environment.NewLine); if (InterProc.HasExited) { setBottomBackColor("#68217a", "#812e96"); /*if (InterProc.ExitCode == 0) * { * // orage * // orage ffa500 * setBottomBackColor("#68217a"); * }else * { * setBottomBackColor("#68217a"); * }*/ } }