public void Upgrade(SettingsContext context, SettingsPropertyCollection properties) {
// Separate the local and roaming settings and upgrade them separately.
SettingsPropertyCollection local = new SettingsPropertyCollection();
SettingsPropertyCollection roaming = new SettingsPropertyCollection();
foreach (SettingsProperty sp in properties) {
bool isRoaming = IsRoamingSetting(sp);
if (isRoaming) {
roaming.Add(sp);
}
else {
local.Add(sp);
}
}
if (roaming.Count > 0) {
Upgrade(context, roaming, true);
}
if (local.Count > 0) {
Upgrade(context, local, false);
}
}