Example #1
0
 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]);
     });
 }
Example #2
0
        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]);
            });
        }