This is a good sample, but it needs one small fix. The example code does
not use a VS created Settings class, but being able to use the designer (Settings.Designer.cs + Settings.cs) with this custom SettingsProvider is very useful. If you are using a VS Settings designer created class, the current implementation will ignore default values (from DefaultSettingValueAttribute). This can be solved by changing the GetPropertyValues() method line:
value.SerializedValue = GetRegKey(setting).GetValue(setting.Name);
to
value.SerializedValue = GetRegKey(setting).GetValue(setting.Name, setting.DefaultValue);
If the registry entry does not exist the settings default value will be returned. This is the desired behavior.