예제 #1
0
 private void Xenax1_DataReceived(object sender, xenaxCommunicationEventArgs e)
 {
     Dispatcher.Invoke(() =>
     {
         txtCommandHistory.AppendText("\r\n" + e.Data);
     }
                       );
 }
예제 #2
0
        private void Xenax1_DataSent(object sender, xenaxCommunicationEventArgs e)
        {
            Dispatcher.Invoke(() =>
            {
                //TextRange tr = new TextRange(txtCommandHistory.Document.ContentEnd, txtCommandHistory.Document.ContentEnd);
                //tr.Text = "\r\n--> " + e.Data;
                //tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.Red);

                txtCommandHistory.AppendText("\r\n--> " + e.Data);
            }
                              );
        }