Example #1
0
 public JournalView()
 {
     InitializeComponent();
     RefreshWarnTypeButton();
     btWarnTypeSelect.Click += (o, e) => {
         SelectWarnTypeView.Show((warnType) => {
             JournalManager.MaxShowingWarnType = warnType;
             RefreshWarnTypeButton();
         });
     };
     _current = this;
 }
 public static void Set(string message, WarnType type, Exception e = null, bool showAnyway = false)
 {
     JournalView.Set(message, type);
     if (type <= MaxShowingWarnType || showAnyway)
     {
         JournalLightWindow.Show(message, type);
     }
     if (type == WarnType.Fatal)
     {
         MessageBox.Show(message + "\r\n" + (e?.Message ?? string.Empty), "Критическая ошибка! Lazurite будет закрыт.", MessageBoxButton.OK, MessageBoxImage.Error);
         System.Windows.Application.Current.Shutdown(1);
     }
 }
Example #3
0
 public static void Set(string message, WarnType type, Exception e = null, bool showAnyway = false)
 {
     JournalView.Set(message, type);
     if (type <= MaxShowingWarnType || showAnyway)
     {
         JournalLightWindow.Show(message, type);
     }
     if (type == WarnType.Fatal)
     {
         Application.Current.Dispatcher.BeginInvoke(new Action(() =>
         {
             var mainWindow = Application.Current.Windows.Cast <Window>().FirstOrDefault(x => x is MainWindow);
             if (mainWindow != null)
             {
                 MessageView.ShowMessage(message + "\r\n" + e?.Message, "Критическая ошибка!", Icons.Icon.Close, mainWindow.Content as Panel, () => Application.Current.Shutdown(1));
             }
         }));
     }
 }