private SettingsPropertyValueCollection GetPropertyValues(SettingsContext context, SettingsPropertyCollection properties, bool returnPrevious)
        {
            bool   anyUserScopedSettings = AnyUserScoped(properties);
            Type   settingsClass         = (Type)context["SettingsClassType"];
            string settingsKey           = (string)context["SettingsKey"];
            string user = anyUserScopedSettings ? Thread.CurrentPrincipal.Identity.Name : null;

            var group = new SettingsGroupDescriptor(settingsClass);

            if (returnPrevious)
            {
                group = _store.GetPreviousSettingsGroup(group);
            }
            else if (anyUserScopedSettings)
            {
                SettingsMigrator.MigrateUserSettings(group);
            }

            var storedValues = new Dictionary <string, string>();

            if (group != null)
            {
                foreach (var userDefault in _store.GetSettingsValues(group, null, settingsKey))
                {
                    storedValues[userDefault.Key] = userDefault.Value;
                }

                if (anyUserScopedSettings)
                {
                    foreach (var userValue in _store.GetSettingsValues(group, user, settingsKey))
                    {
                        storedValues[userValue.Key] = userValue.Value;
                    }
                }
            }

            return(GetSettingsValues(properties, storedValues));
        }
Пример #2
0
 public abstract void RemoveUserSettings(SettingsGroupDescriptor group, string user, string instanceKey);
Пример #3
0
 public abstract void PutSettingsValues(SettingsGroupDescriptor group, string user, string instanceKey, Dictionary <string, string> dirtyValues);
Пример #4
0
 public abstract Dictionary <string, string> GetSettingsValues(SettingsGroupDescriptor group, string user, string instanceKey);
Пример #5
0
 public abstract void ImportSettingsGroup(SettingsGroupDescriptor group, List <SettingsPropertyDescriptor> properties);
Пример #6
0
 public abstract IList <SettingsPropertyDescriptor> ListSettingsProperties(SettingsGroupDescriptor group);
Пример #7
0
 public abstract SettingsGroupDescriptor GetPreviousSettingsGroup(SettingsGroupDescriptor group);
Пример #8
0
 public static UserSettingsUpgradeStep Create(SettingsGroupDescriptor settingsGroup)
 {
     return(Create(ApplicationSettingsHelper.GetSettingsClass(settingsGroup)));
 }
Пример #9
0
 public static bool MigrateSharedSettings(SettingsGroupDescriptor settingsGroup, string previousExeConfigFilename)
 {
     return(MigrateSharedSettings(ApplicationSettingsHelper.GetSettingsClass(settingsGroup), previousExeConfigFilename));
 }
Пример #10
0
 public static bool MigrateUserSettings(SettingsGroupDescriptor settingsGroup)
 {
     return(MigrateUserSettings(ApplicationSettingsHelper.GetSettingsClass(settingsGroup)));
 }