示例#1
0
        public ICollection <UserUpgradeStep> CreateSteps()
        {
            var upgradeSteps = new List <UserUpgradeStep>();

            if (UpgradeSettings.IsUserUpgradeEnabled())
            {
                foreach (var group in SettingsGroupDescriptor.ListInstalledSettingsGroups())
                {
                    try
                    {
                        UserSettingsUpgradeStep step = UserSettingsUpgradeStep.Create(group);
                        if (step != null)
                        {
                            upgradeSteps.Add(step);
                        }
                    }
                    catch (Exception e)
                    {
                        Platform.Log(LogLevel.Warn, e, "Unable to migrate user settings: {0}", group.Name);
                    }
                }
            }

            return(upgradeSteps);
        }
示例#2
0
        public static bool MigrateUserSettings(Type settingsClass)
        {
            UserSettingsUpgradeStep step = UserSettingsUpgradeStep.Create(settingsClass);

            return(step != null && step.Run());
        }