Dispose() публичный Метод

public Dispose ( ) : void
Результат void
Пример #1
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose();

            SaveSettings();

            if (_lightlyFilteredGazePointDataProvider != null)
            {
                _lightlyFilteredGazePointDataProvider.Next -= NewGazePoint;
                _lightlyFilteredGazePointDataProvider.Dispose();
            }

            if (_host != null)
            {
                _host.Dispose();
            }

            if (_controllerEmulation != null)
            {
                _controllerEmulation.OnModifyState -= OnModifyControllerState;
                _controllerEmulation.Dispose();
            }

            if (_gazeVisualization != null)
            {
                _gazeVisualization.Dispose();
            }

            if (_foregroundWindowWatcher != null)
            {
                _foregroundWindowWatcher.Dispose();
            }
        }
Пример #2
0
        private void ShutDown()
        {
            Debug.Log("Begin ShutDown");
            _shutDownRequestFlag = true;
            KeyDown -= OnKeyDown;
            Tick    -= OnTick;
            Aborted -= OnAborted;
            AppDomain.CurrentDomain.ProcessExit -= AppDomainOnProcessExit;

            _shutDownRequestedEvent.WaitOne(100);
            _settingsStorage.SaveSettings(_settings);

            //General
            RecordGameSessionEnded();

            if (_controlsProcessor != null)
            {
                _controlsProcessor.Dispose();
                _controlsProcessor = null;
            }

            //Window
            if (_foregroundWindowWatcher != null)
            {
                _foregroundWindowWatcher.Dispose();
                _foregroundWindowWatcher = null;
            }

            //Menu
            if (_settingsMenu != null)
            {
                _settingsMenu = null;
            }

            //Features
            if (_aiming != null)
            {
                _aiming.Dispose();
                _aiming = null;
            }

            if (_extendedView != null)
            {
                _extendedView.Dispose();
                _extendedView = null;
            }

            //Hids
            if (_controllerEmulation != null)
            {
                _controllerEmulation.Enabled = false;
                _controllerEmulation.RemoveHooks();
                _controllerEmulation = null;
            }

            if (_tobiiTracker != null)
            {
                _tobiiTracker.Dispose();
                _tobiiTracker = null;
            }
            Debug.Log("End ShutDown");
        }
Пример #3
0
        private void ShutDown()
        {
            _shutDownRequestFlag = true;
            KeyDown -= OnKeyDown;
            Tick    -= OnTick;

            _shutDownRequestedEvent.WaitOne(100);
            Util.Log("Begin ShutDown");
            _settingsStorage.SaveSettings(_settings);

            //General
            RecordGameSessionEnded();

            if (_controlsProcessor != null)
            {
                _controlsProcessor.Dispose();
                _controlsProcessor = null;
            }

            //Window
            if (_foregroundWindowWatcher != null)
            {
                _foregroundWindowWatcher.Dispose();
                _foregroundWindowWatcher = null;
            }

            //Menu
            if (_settingsMenu != null)
            {
                _settingsMenu.ShutDownRequested -= SettingsMenuOnShutDownRequested;
                _settingsMenu = null;
            }

            //Gaze
            if (_lightlyFilteredGazePointDataProvider != null)
            {
                _lightlyFilteredGazePointDataProvider.Next -= NewGazePoint;
                _lightlyFilteredGazePointDataProvider.Dispose();
                _lightlyFilteredGazePointDataProvider = null;
            }

            if (_host != null)
            {
                _host.Dispose();
                _host = null;
            }

            //Features
            if (_aiming != null)
            {
                _aiming.Dispose();
                _aiming = null;
            }

            if (_freelook != null)
            {
                _freelook.Dispose();
                _freelook = null;
            }

            //Hids
            if (_controllerEmulation != null)
            {
                _controllerEmulation.Enabled = false;
                _controllerEmulation.RemoveHooks();
                _controllerEmulation = null;
            }
            Util.Log("End ShutDown");
        }