// This should now only get called when the game is exiting
        private void OnDestroy()
        {
            Log.Info("Shutting down");
#if falsae
            if (HighLogic.LoadedScene == GameScenes.TRACKSTATION)
            {
                OnExitMapView();
            }
            else
#endif
            {
                MapView.OnEnterMapView -= OnEnterMapView;
                MapView.OnExitMapView  -= OnExitMapView;
            }

            Log.Debug("Disposing window");
            m_window.Dispose();

            Log.Debug("Disposing OrbitVisibilityController");
            m_visibilityController.OnVisibilityChanged -= OnOrbitVisibilityChanged;
            m_visibilityController.Dispose();

            Log.Debug("Writing configuration file");
            string configurationDirectory = Path.GetDirectoryName(ConfigurationFile);
            if (configurationDirectory != null && !Directory.Exists(configurationDirectory))
            {
                Directory.CreateDirectory(configurationDirectory);
            }
            ConfigurationParser.SaveToFile(ConfigurationFile, m_configuration);
        }
        private void OnDestroy()
        {
            Logger.Info("Shutting down");
            MapView.OnEnterMapView -= OnEnterMapView;
            MapView.OnExitMapView  -= OnExitMapView;

            Logger.Debug("Disposing ToolbarButton");
            m_toolbarButton.Dispose();

            Logger.Debug("Disposing window");
            m_window.Dispose();

            Logger.Debug("Disposing OrbitVisibilityController");
            m_visibilityController.OnVisibilityChanged -= OnOrbitVisibilityChanged;
            m_visibilityController.Dispose();

            Logger.Debug("Writing configuration file");
            string configurationDirectory = Path.GetDirectoryName(ConfigurationFile);

            if (configurationDirectory != null && !Directory.Exists(configurationDirectory))
            {
                Directory.CreateDirectory(configurationDirectory);
            }
            ConfigurationParser.SaveToFile(ConfigurationFile, m_configuration);
        }
예제 #3
0
 private void CloseApp()
 {
     if (_window != null)
     {
         _window.Close();
         _window.Dispose();
         _window = null;
     }
 }
 public void TearDown()
 {
     _window.Close();
     _window.Dispose();
     if (BasilProject.IsInitialized)
     {
         WeSayWordsProject.Project.Dispose();
     }
 }
예제 #5
0
 public void TearDown()
 {
     _window.Close();
     _window.Dispose();
     Palaso.UI.WindowsForms.Keyboarding.KeyboardController.Shutdown();
 }