I thought the Reset() method repopulates the Settings with default values again, but it seems not to. How can I reload them with the default values?
private void buttonLoadDefaultSettings_Click(object sender, EventArgs e)
{
FooSettings.Default.Reset();
// Data grid will show an empty grid after call to reset.
DataGridFoo.Rows.Clear();
foreach (SettingsPropertyValue spv in FooSettings.Default.PropertyValues)
{
DataGridFoo.Rows.Add(spv.Name, spv.PropertyValue);
}
}
Update
private void buttonLoadDefaultSettings_Click(object sender, EventArgs e)
{
foreach (SettingsProperty sp in FooSettings.Default.Properties)
{
FooSettings.Default[sp.Name.ToString()] = sp.DefaultValue;
}
DataGridFoo.Rows.Clear();
foreach (SettingsPropertyValue spv in FooSettings.Default.PropertyValues)
{
DataGridFoo.Rows.Add(spv.Name, spv.PropertyValue);
}
}
Removed the call to Reset() and set the property values manually to the default stored ones. I'm still eager to hear if this is the way it's supposed to be used or am I missing something?