Example #1
0
 private void Window_Closing(object sender, CancelEventArgs e)
 {
     ExecuteWindowBehavior(App.Settings.ExitBehavior);
     if (ignoreclose)
     {
         e.Cancel = true;
     }
     else
     {
         NotifyIcon.Visibility = System.Windows.Visibility.Hidden;
         state.Shutdown();
         Environment.Exit(0);
     }
 }
Example #2
0
 public void Shutdown()
 {
     System.Threading.Tasks.Task.Factory.StartNew(new Action(() =>
     {
         System.Threading.Thread.Sleep(2500);
         State.Shutdown();
         App.Current.Dispatcher.Invoke(new Action(() => { App.Current.Shutdown(0); }));
     }));
 }