public void LogSay(object sender, DebugLogEventArgs args) { LogEntry newEntry = new LogEntry() { Text = args.Text }; newEntry.Foreground = "Red"; newEntry.Justification = "Right"; App.Current.Dispatcher.Invoke((Action) delegate { _items.Add(newEntry); LogListBox.ScrollIntoView(LogListBox.Items[LogListBox.Items.Count - 1]); }); }
public void LogSpeech(object sender, DebugLogEventArgs args) { LogEntry newEntry = new LogEntry() { Text = args.Text }; if (args.Accepted) { newEntry.Foreground = "LightBlue"; } else { newEntry.Foreground = "Khaki"; } newEntry.Justification = "Left"; App.Current.Dispatcher.Invoke((Action) delegate { _items.Add(newEntry); LogListBox.ScrollIntoView(LogListBox.Items[LogListBox.Items.Count - 1]); }); }
public virtual void DebugLog(string Text, int Verbosity = 1) { if (this.DebugLogEvent != null) { DebugLogEventArgs args = new DebugLogEventArgs(); args.Verbosity = Verbosity; args.Message = Text; this.DebugLogEvent(this, args); } }