void CloseGinger()
        {
            // app.Shutdown(0);
            MainWindowPOM.Close();
            Thread.Sleep(5000);

            //while (!Dispatcher.CurrentDispatcher.HasShutdownFinished)
            //{
            //    Thread.Sleep(100);
            //}

            //MainWindowPOM.Dispatcher.Invoke(() => {
            //    try
            //    {
            //        //Console.WriteLine("Closing Ginger");
            //        //app.ShutdownMode = ShutdownMode.OnMainWindowClose;
            //        // Thread.Sleep(30000);

            //        //Console.WriteLine("MainWindow closed");

            //        //app.Shutdown();
            //        //app = null;
            //        //int i = 0;
            //        //while (mGingerThread.IsAlive  && i<100)
            //        //{
            //        //    Thread.Sleep(100);
            //        //    i++;
            //        //}

            //        //int i = 0;
            //        //while (app.Windows.Count > 0 && i < 100) //max 10 seconds for closing all windows
            //        //{
            //        //    i++;
            //        //    Thread.Sleep(100);
            //        //}
            //        //app.Shutdown();
            //    }
            //    catch(Exception ex)
            //    {

            //    }

            //Thread.Sleep(5000);
            //});

            // Thread.Sleep(30000);
            // mGingerThread.Abort();
        }
Exemple #2
0
 void CloseGinger()
 {
     // app.Shutdown(0);
     MainWindowPOM.Close();
     Thread.Sleep(5000);
 }
Exemple #3
0
 internal void CloseGinger()
 {
     MainWindowPOM.Close();
     mutex.ReleaseMutex();
 }