private void Log_MessageLogged(object sender, Logger.LogEvents e) { if (e.Output == OutputType.MsgBox) { MessageBox.Show(e.Message); } else { OutputLog.Dispatcher.BeginInvoke((Action)(() => { OutputLog.AppendText(e.Message); OutputLog.ScrollToEnd(); })); if (e.Output == OutputType.Both) { System.Windows.Forms.MessageBox.Show(e.Message.Replace(">> ", "")); } } bool showConsoleFlash = Settings.LoadedSettings.ConsoleFlash; bool isConsoleCollapsed = OutputLog.Visibility == Visibility.Collapsed; if (showConsoleFlash && isConsoleCollapsed) { blinkTimer.Start(); } }
private void Logger_MessageLogged(object sender, Logger.LogEvents e) { Main.RunOnUIThread(() => { debugUC.OutputConsole.AppendText($">> {e.Message}\n"); debugUC.OutputConsole.CaretPosition = debugUC.OutputConsole.Document.ContentEnd; }); }
private void Logger_MessageLogged(object sender, Logger.LogEvents e) { if (e.MessageDisplayTime <= 0) { const int defaultTime = 2500; e.MessageDisplayTime = defaultTime; } msgQueue.Enqueue(e); if (msgQueue.Peek() == e) //Only one in queue because first one is the one we just added { RunMsgThread(); } }
private void Logger_MessageLogged(object sender, Logger.LogEvents e) { if (e.LogType == Logger.LogType.MessageBox) { MessageBox.Show(e.Message); } RunOnUIThread(() => { if (e.LogType == Logger.LogType.Console) { System.Diagnostics.Debug.WriteLine(e.Message); } }); }