public void Execute() { if (HideOnFinish) this.Visible = true; using (components.Shared.Objects.TextBoxStreamWriter tb = new components.Shared.Objects.TextBoxStreamWriter(richTextBox1)) { if (ShowScroll) richTextBox1.ScrollBars = RichTextBoxScrollBars.Both; else richTextBox1.ScrollBars = RichTextBoxScrollBars.None; tb.TextBuffer = this.TextBuffer; Console.SetOut(tb); this.backgroundWorker1.RunWorkerAsync(); //Console.Clear(); while (this.backgroundWorker1.IsBusy) { Application.DoEvents(); } tb.Close(); } if (HideOnFinish) this.Visible = false; }
public void Execute() { if (HideOnFinish) this.Visible = true; using (components.Shared.Objects.TextBoxStreamWriter tb = new components.Shared.Objects.TextBoxStreamWriter(richTextBox1)) { if (ShowScroll) richTextBox1.ScrollBars = RichTextBoxScrollBars.Both; else richTextBox1.ScrollBars = RichTextBoxScrollBars.None; tb.TextBuffer = this.TextBuffer; Console.SetOut(tb); this.backgroundWorker1.RunWorkerAsync(); //Console.Clear(); while (this.backgroundWorker1.IsBusy) { Application.DoEvents(); } tb.Close(); } if (HideOnFinish) this.Visible = false; }