Example #1
0
 private void OnStreamReceived(OsmpStream stream)
 {
     this.Dispatcher.BeginInvoke(new Action(() =>
     {
         ProtocolListingTextBox.AppendText("\nGOT STREAM: Cmd=" + stream.Id + " " + JsonConvert.SerializeObject(stream.Data) + "\n");
         ProtocolListingTextBox.ScrollToEnd();
     }));
 }
Example #2
0
 private void OnEventsReceived(OsmpEvent[] events)
 {
     this.Dispatcher.BeginInvoke(new Action(() =>
     {
         foreach (var ev in events)
         {
             ProtocolListingTextBox.AppendText("\nGOT EVENT: " + ev.Id + ": " +
                                               JsonConvert.SerializeObject(ev.Data) + "\n");
         }
         ProtocolListingTextBox.ScrollToEnd();
     }));
 }
Example #3
0
 private void OnMessageReceived(string obj)
 {
     if (obj == null)
     {
         return;
     }
     this.Dispatcher.BeginInvoke(new Action(() =>
     {
         ProtocolListingTextBox.AppendText("\nRX: " + obj + "\n");
         ProtocolListingTextBox.ScrollToEnd();
     }));
 }
Example #4
0
        private void OnMessageSent(string obj, bool success)
        {
            if (obj == null)
            {
                return;
            }
            var failed = success ? "" : " FAILED";

            this.Dispatcher.BeginInvoke(new Action(() =>
            {
                ProtocolListingTextBox.AppendText("\nTX" + failed + ":\n" + obj + "\n");
                ProtocolListingTextBox.ScrollToEnd();
            }));
        }
Example #5
0
 private void OnError(string msg, Exception e)
 {
     this.Dispatcher.BeginInvoke(new Action(() =>
     {
         if (e == null)
         {
             ProtocolListingTextBox.AppendText("\nERROR: " + msg + "\n");
         }
         else
         {
             ProtocolListingTextBox.AppendText("\nERROR: " + msg + "\n\t" + e.Message + "\n" + e.StackTrace + "\n");
         }
         ProtocolListingTextBox.ScrollToEnd();
     }));
 }