private void OnWindowClosing(object sender, CancelEventArgs e) { SysTray.DestroySystemTray(); AppBarHelper.RegisterBar(this, this.ActualWidth, this.ActualHeight); WinSparkle.win_sparkle_cleanup(); if (Startup.IsCairoUserShell) { AppBarHelper.ResetWorkArea(); } }
private void OnWindowClosing(object sender, CancelEventArgs e) { if (CairoMessage.ShowOkCancel("You will need to reboot or use the start menu shortcut in order to run Cairo again.", "Are you sure you want to exit Cairo?", "Resources/cairoIcon.png", "Exit Cairo", "Cancel") == true) { //SHAppBarMessageHelper.DeRegisterBar(handle); System.Drawing.Size size = new System.Drawing.Size((int)this.ActualWidth, (int)this.ActualHeight); SHAppBarMessageHelper.RegisterBar(handle, size); SysTray.DestroySystemTray(); Application.Current.Shutdown(); } else { e.Cancel = true; } }
private void OpenCloseCairoBox(object sender, RoutedEventArgs e) { bool?CloseCairoChoice = CairoMessage.ShowOkCancel("You will need to reboot or use the start menu shortcut in order to run Cairo again.", "Are you sure you want to exit Cairo?", "Resources/cairoIcon.png", "Exit Cairo", "Cancel"); if (CloseCairoChoice.HasValue && CloseCairoChoice.Value) { //SHAppBarMessageHelper.DeRegisterBar(handle); System.Drawing.Size size = new System.Drawing.Size((int)this.ActualWidth, (int)this.ActualHeight); SHAppBarMessageHelper.RegisterBar(handle, size); SysTray.DestroySystemTray(); Application.Current.Shutdown(); // TODO: Will want to relaunch explorer.exe when we start disabling it } else { } }