Exemple #1
0
        private void SaveSettings()
        {
            if (!_settingsStore.CollectionExists(settingsCategoryName))
            {
                _settingsStore.CreateCollection(settingsCategoryName);
            }

            var legacySerializer = new LegacyConfigurationSerializer <ControlSettings>();
            var value            = legacySerializer.Serialize(Settings);

            _settingsStore.SetString(settingsCategoryName, settingsPropertyName, value);
        }
        /// <remarks>
        /// Settings are stored under "HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\[12.0Exp]\BuildVision\".
        /// </remarks>
        private static void SaveSettings(ControlSettings settings, IServiceProvider serviceProvider)
        {
            var store = GetWritableSettingsStore(serviceProvider);

            if (!store.CollectionExists(settingsCategoryName))
            {
                store.CreateCollection(settingsCategoryName);
            }

            var legacySerializer = new LegacyConfigurationSerializer <ControlSettings>();
            var value            = legacySerializer.Serialize(settings);

            store.SetString(settingsCategoryName, settingsPropertyName, value);
        }