示例#1
0
        void Logger_OnWrite(string s, Brush b = null)
        {
            Dispatcher.Invoke(() =>
            {
                if (string.IsNullOrEmpty(s))
                {
                    return;
                }

                //OutputTab.Focus();

                if (b != null)
                {
                    TextRange tr = new TextRange(CompileOutputTextbox.Document.ContentEnd,
                                                 CompileOutputTextbox.Document.ContentEnd)
                    {
                        Text = s
                    };
                    tr.ApplyPropertyValue(TextElement.ForegroundProperty, b);
                }
                else
                {
                    CompileOutputTextbox.AppendText(s);
                }

                CompileOutputTextbox.ScrollToEnd();
            });
        }
示例#2
0
 void CompilingManager_OnClear()
 {
     Dispatcher.Invoke(() =>
     {
         CompileOutputTextbox.Document.Blocks.Clear();
         CompileOutputTextbox.AppendText(Environment.NewLine);
     });
 }