private void OnStreamReceived(OsmpStream stream) { this.Dispatcher.BeginInvoke(new Action(() => { ProtocolListingTextBox.AppendText("\nGOT STREAM: Cmd=" + stream.Id + " " + JsonConvert.SerializeObject(stream.Data) + "\n"); ProtocolListingTextBox.ScrollToEnd(); })); }
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(); })); }
private void OnMessageReceived(string obj) { if (obj == null) { return; } this.Dispatcher.BeginInvoke(new Action(() => { ProtocolListingTextBox.AppendText("\nRX: " + obj + "\n"); ProtocolListingTextBox.ScrollToEnd(); })); }
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(); })); }
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(); })); }