Пример #1
0
        private void MonitorData(byte[] buf, int size)
        {
            byte[] data = buf.Take(size).ToArray();

            string t = TransToString(data);

            Dispatcher.Invoke(() => {
                MonitorTextBox.AppendText(t);
            });
        }
Пример #2
0
 private void Monitor(string str)
 {
     try
     {
         this.Dispatcher.Invoke(() =>
         {
             MonitorTextBox.AppendText(str + Environment.NewLine);
             MonitorTextBox.ScrollToLine(MonitorTextBox.LineCount - 1);
         });
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }