private void Upgrade(SettingsContext context, SettingsPropertyCollection properties, bool isRoaming) {
string prevConfig = GetPreviousConfigFileName(isRoaming);
if (!String.IsNullOrEmpty(prevConfig)) {
//Filter the settings properties to exclude those that have a NoSettingsVersionUpgradeAttribute on them.
SettingsPropertyCollection upgradeProperties = new SettingsPropertyCollection();
foreach (SettingsProperty sp in properties) {
if (!(sp.Attributes[typeof(NoSettingsVersionUpgradeAttribute)] is NoSettingsVersionUpgradeAttribute)) {
upgradeProperties.Add(sp);
}
}
SettingsPropertyValueCollection values = GetSettingValuesFromFile(prevConfig, GetSectionName(context), true, upgradeProperties);
SetPropertyValues(context, values);
}
}