private void BotClient_OnResponse(string message, MessageType type) { switch (type) { case MessageType.History: this.Dispatcher.BeginInvoke((Action)(() => { if (message.Contains(requestName)) { StartButton_Click(this, new RoutedEventArgs()); } HistoryText.AppendText(message + "\n"); SendText.Focus(); HistoryText.ScrollToEnd(); })); break; case MessageType.Metadata: this.Dispatcher.BeginInvoke((Action)(() => { MetaText.AppendText(message + "\n"); SendText.Focus(); MetaText.ScrollToEnd(); })); break; default: break; } }
private void BotClient_OnError(object sender, EventArgs e) { MetaText.AppendText((e as UnhandledExceptionEventArgs).ExceptionObject.ToString()); }