private void OnStartSession(string title) { Dispatcher.Invoke(() => { LogTextBox.Text = title + "\n==========="; LogScroll.ScrollToEnd(); EnrollBtn.IsEnabled = false; AuthBtn.IsEnabled = false; DeleteUsersBtn.IsEnabled = false; AuthLoopBtn.IsEnabled = false; AuthSettingsBtn.IsEnabled = false; RedDot.Visibility = Visibility.Visible; _lastAuthHint = rsid.AuthStatus.Serial_Ok; }); }
public void NewLog(string txt, LogType type = LogType.Black, bool debug = false) { SolidColorBrush color; switch (type) { case LogType.Black: color = Brushes.Black; break; case LogType.Green: color = Brushes.ForestGreen; break; case LogType.Red: color = Brushes.Brown; break; case LogType.Blue: color = Brushes.DeepSkyBlue; break; default: color = Brushes.Black; break; } Dispatcher.Invoke(() => { var time = DateTime.Now; var dTxt = debug ? "[DEBUG]" : ""; TbLog.Inlines.Add(new Run($"[{time.ToString("HH:mm:ss", CultureInfo.InvariantCulture)}]{dTxt}: {txt}.{Environment.NewLine}") { Foreground = color }); LogScroll.ScrollToEnd(); }); }
private void Log(string log) { StatusBar.Content = log; StatusView.Text += log + "\n"; LogScroll.ScrollToEnd(); }
private void LogUpdated(DependencyObject sender, DependencyProperty dp) { LogScroll.ChangeView(null, LogScroll.ScrollableHeight, null); }
private void WriteLog(string message) { Log.Text += message + " (stardate " + Stardate + ")" + Environment.NewLine; LogScroll.ChangeView(0, double.MaxValue, 1); }
private void WriteLog(string message = "") { Log.Text += message + Environment.NewLine; LogScroll.ChangeView(null, LogScroll.ExtentHeight, null); }