Example #1
0
        public void SaveUserSettings(UserSettingsModel userSettings)
        {
            SettingsManager       settingsManager   = new ShellSettingsManager(this);
            WritableSettingsStore userSettingsStore = settingsManager.GetWritableSettingsStore(SettingsScope.UserSettings);

            ReferencesResolverExtensionPackage.EnsureSettingsStoreCollectionExists(userSettingsStore);
            string settingsJson = ConvertUserSettingToJson(userSettings);

            userSettingsStore.SetString(PathCollectionString, UserSettingsProperty, settingsJson);
        }
Example #2
0
        public UserSettingsModel GetUserSettings()
        {
            SettingsManager       settingsManager   = new ShellSettingsManager(this);
            WritableSettingsStore userSettingsStore = settingsManager.GetWritableSettingsStore(SettingsScope.UserSettings);

            ReferencesResolverExtensionPackage.EnsureSettingsStoreCollectionExists(userSettingsStore);
            string            settingsJson = userSettingsStore.GetString(PathCollectionString, UserSettingsProperty, DefaultUserSettingsJson);
            UserSettingsModel userSettings = GetUserSettingsFromJson(settingsJson);

            return(userSettings);
        }