void MainWindow_Closing(object sender, CancelEventArgs evtArgs) { m_timer.Stop(); m_timer.Close(); Save(); if (null != m_chatWnd) { m_chatWnd.Exit(); } try { //Save here always, in case there was some problem with the dirty logic. if (!m_games.SaveGames(m_config)) { MessageBoxResult mbr = System.Windows.MessageBox.Show("There was an error saving games. Do you still want to exit?", "Confirm Ceebeetle Exit", MessageBoxButton.YesNo); if (mbr == MessageBoxResult.No) { evtArgs.Cancel = true; } } if (!m_storeManager.SaveStores(m_config)) { CCBLogConfig.GetLogger().Log("Failed to write store file. Ignoring for now."); } CCBLogConfig.Close(); } catch (IOException iox) { CCBLogConfig.GetLogger().Log(iox.ToString()); evtArgs.Cancel = true; } }