Reference types in application settings
Hi, I am using .NET 4 and I have some troubles with application settings. Using simple value types (int, string, Point, Size etc.) and their default values is OK, but when I add a reference type to the settings (say an object of type System.Drawing.Printing.PageSettings), how do I specify the default value? One solution would be to add a new (perhaps static) class Settings which would call ApplicationSettingsBase.Reload() method, then check whether any of the reference types is null and initialize it properly. Is there any other preferred solution?
Also many of the articles/howtos/faqs about application settings in .NET mention the possibility to bind them to properties of controls in WinForms. Is the whole concept of app settings really that focused on the property bindings or is it usable also for general settings that do not have their counterpart in any control?
Re: Reference types in application settings
If you ask me those application settings that they give you are pretty darn worthless. Ypu are far better off to just make your own settings class and implement IXMLSerilizable, then you can have whatever you want being saved.