Exemplo n.º 1
0
 public void SavePreferences(AppPreferences preferences)
 {
     if (!Properties.Settings.Default.TransactionCachePath.Equals(preferences.TransactionCacheLocation, System.StringComparison.InvariantCultureIgnoreCase))
     {
         Properties.Settings.Default.TransactionCachePath = preferences.TransactionCacheLocation;
         Properties.Settings.Default.Save();
         _mainFormPresenter.InitializeTransactionCache();
     }
 }
        public void SavePreferences(AppPreferences preferences)
        {
            if (!_propertiesRepository.GetValue <string>(Constants.AppProperties.TransactionCachePath).Equals(preferences.TransactionCacheLocation, System.StringComparison.InvariantCultureIgnoreCase))
            {
                _propertiesRepository.SetValue(Constants.AppProperties.TransactionCachePath, preferences.TransactionCacheLocation);
                _propertiesRepository.Save();
                _mainFormPresenter.InitializeTransactionCache();
            }

            if (_propertiesRepository.GetValue <bool>(Constants.AppProperties.UseDarkTheme) != preferences.UseDarkTheme)
            {
                _propertiesRepository.SetValue(Constants.AppProperties.UseDarkTheme, preferences.UseDarkTheme);
                _propertiesRepository.Save();
                _pubsub.Publish(this, new PubSubEventArgs {
                    Data = preferences.UseDarkTheme
                }, Constants.SubscriptionTypes.THEME_CHANGE);
                _view.RenderTheme();
            }
        }