Example #1
0
        private void Log(String text)
        {
            MyForm.Invoke(new Action(
                              delegate()
            {
                MyRichTextBox.Text          += text + Environment.NewLine;
                MyRichTextBox.SelectionStart = MyRichTextBox.Text.Length;
                MyRichTextBox.ScrollToCaret();
            }));

            MyForm.Invoke(new Action(
                              delegate()
            {
                MyForm.Refresh();
            }));
        }
Example #2
0
        private void LogException(Exception ex)
        {
            MyForm.Invoke(new Action(
                              delegate()
            {
                MyRichTextBox.Text          += ex.Message + Environment.NewLine;
                MyRichTextBox.Text          += ex.StackTrace + Environment.NewLine;
                MyRichTextBox.SelectionStart = MyRichTextBox.Text.Length;
                MyRichTextBox.ScrollToCaret();
            }));

            MyForm.Invoke(new Action(
                              delegate()
            {
                MyForm.Refresh();
            }));
        }