Exemplo n.º 1
0
        protected virtual void Dispose(bool disposing)
        {
            if (!_disposed)
            {
                Stopwatch.Normal("App.OnExit - Exit cost", () =>
                {
                    Log.Info("Start PowerToys Run Exit----------------------------------------------------  ", GetType());
                    if (disposing)
                    {
                        if (_themeManager != null)
                        {
                            _themeManager.ThemeChanged -= OnThemeChanged;
                        }

                        API?.SaveAppAllSettings();
                        PluginManager.Dispose();
                        _mainWindow?.Dispose();
                        API?.Dispose();
                        _mainVM?.Dispose();
                        _themeManager?.Dispose();
                        _disposed = true;
                    }

                    // TODO: free unmanaged resources (unmanaged objects) and override finalizer
                    // TODO: set large fields to null
                    _disposed = true;
                    Log.Info("End PowerToys Run Exit ----------------------------------------------------  ", GetType());
                });
            }
        }
Exemplo n.º 2
0
        protected virtual void Dispose(bool disposing)
        {
            if (!_disposed)
            {
                if (disposing)
                {
                    _mainWindow.Dispose();
                    API.SaveAppAllSettings();
                    _disposed = true;
                }

                // TODO: free unmanaged resources (unmanaged objects) and override finalizer
                // TODO: set large fields to null
                _disposed = true;
            }
        }
Exemplo n.º 3
0
        protected virtual void Dispose(bool disposing)
        {
            if (!_disposed)
            {
                Stopwatch.Normal("|App.OnExit|Exit cost", () =>
                {
                    Log.Info("|App.OnExit| Start PowerToys Run Exit----------------------------------------------------  ");
                    if (disposing)
                    {
                        _mainWindow.Dispose();
                        API.SaveAppAllSettings();
                        _mainVM.Dispose();
                        _disposed = true;
                    }

                    // TODO: free unmanaged resources (unmanaged objects) and override finalizer
                    // TODO: set large fields to null
                    _disposed = true;
                    Log.Info("|App.OnExit| End PowerToys Run Exit ----------------------------------------------------  ");
                });
            }
        }