Ejemplo n.º 1
0
        public override void SaveSettingsToStorage()
        {
            EnsureOptionPageCreated();

            // Allow page controls to perist their settings to the option store before updating the
            // option service.
            pageControl.OnSave();

            // Save the changes that were accumulated in the option store.
            var oldOptions = s_optionService.GetOptions();
            var newOptions = s_optionStore.GetOptions();

            // Must log the option change before setting the new option values via s_optionService,
            // otherwise oldOptions and newOptions would be identical and nothing will be logged.
            OptionLogger.Log(oldOptions, newOptions);
            s_optionService.SetOptions(newOptions);

            // Make sure we load the next time a page is activated, in case that options changed
            // programmatically between now and the next time the page is activated
            s_needsToUpdateOptionStore = true;

            // For pages that don't use option bindings we need to load settings when it is
            // activated next.
            _needsLoadOnNextActivate = true;
        }
Ejemplo n.º 2
0
        internal override void SaveSettings()
        {
            var optionSet      = this.OptionService.GetOptions();
            var changedOptions = this.ViewModel.ApplyChangedOptions(optionSet);

            this.OptionService.SetOptions(changedOptions);
            OptionLogger.Log(optionSet, changedOptions);
        }
Ejemplo n.º 3
0
        public void SetOption <T>(Option <T> option, T value)
        {
            var oldOptions = _optionSet;

            _optionSet = _optionSet.WithChangedOption(option, value);
            OptionLogger.Log(oldOptions, _optionSet);

            OnOptionChanged(new OptionKey(option));
        }
Ejemplo n.º 4
0
        public void SetOption <T>(PerLanguageOption <T> option, string language, T value)
        {
            var oldOptionSet = _optionSet;

            _optionSet = _optionSet.WithChangedOption(option, language, value);
            OptionLogger.Log(oldOptionSet, _optionSet);

            OnOptionChanged(new OptionKey(option, language));
        }
Ejemplo n.º 5
0
        public void SetOption(OptionKey optionKey, object value)
        {
            var oldOptions = _optionSet;

            _optionSet = _optionSet.WithChangedOption(optionKey, value);
            OptionLogger.Log(oldOptions, _optionSet);

            OnOptionChanged(optionKey);
        }