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(); }