When I create a settings file, Visual Studio generates a singleton with the instance name Default:
Properties.Settings.Default.SettingIHaveSaved
How can I get Visual Studio to generate another list of settings with a new instance name? Say,
开发者_如何学运维Properties.Settings.Debug.SettingIHaveSaved
Thanks!
You can't get Visual Studio to generate this property but you can easily add this behavior. Settings
is implemented as a partial class so you just need to create a new file with another partial declaration and add the property you want there.
For example
internal partial class Settings {
private static Settings _debugInstance = ApplicationSettingsBase.Synchronized(new Settings());
internal static Settings Debug {
get { return _debugInstance; }
}
}
精彩评论