private static void ShowSettings() { new Settings().ShowDialog(); if (!ArkadeProcessingAreaLocationSetting.IsValid()) { ShowInvalidProcessingAreaLocationDialog(); } RestartArkadeIfNeededAndWanted(); }
protected override void OnExit(ExitEventArgs e) { _log.Information("Arkade " + ArkadeVersion.Current + " stopping"); if (!ArkadeProcessingAreaLocationSetting.IsApplied()) { ArkadeProcessingArea.Destroy(); } else if (ArkadeInstance.IsOnlyInstance) { ArkadeProcessingArea.CleanUp(); } base.OnExit(e); }
private static void RestartArkadeIfNeededAndWanted() { bool restartIsNeeded = !ArkadeProcessingAreaLocationSetting.IsApplied(); if (restartIsNeeded) { bool restartIsWanted = MessageBox.Show( Resources.GUI.RestartArkadeForChangesToTakeEffectPrompt, Resources.GUI.RestartArkadeDialogTitle, MessageBoxButtons.YesNo) == DialogResult.Yes; if (restartIsWanted) { System.Windows.Forms.Application.Restart(); System.Windows.Application.Current.Shutdown(); } } }
public MainWindow() { try { InitializeComponent(); Title = UI.Resources.UI.General_WindowTitle; Loaded += (sender, e) => { if (!ArkadeProcessingAreaLocationSetting.IsValid()) { ((MainWindowViewModel)DataContext).ShowInvalidProcessingAreaLocationDialogCommand.Execute(); } }; } catch (Exception e) { new DetailedExceptionMessage(e).ShowMessageBox(); throw; } }