示例#1
0
 private void LogRtbClear()
 {
     if (LogRtb.CheckAccess())
     {
         LogRtb.Document.Blocks.Clear();
     }
     else
     {
         Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() => LogRtb.Document.Blocks.Clear()));
     }
 }
示例#2
0
        private void LogRtbAppendText(String someText)
        {
            if (LogRtb.CheckAccess())
            {
                LogRtb.AppendText(someText);
                LogRtb.ScrollToEnd();
            }

            else
            {
                Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() =>
                {
                    LogRtb.AppendText(someText);
                    LogRtb.ScrollToEnd();
                }));
            }
        }