What is the preferred way to configure a mono application
When using VS, the preferred way to 开发者_如何学JAVAstore user- and application settings seems to be to access VS "settings" tab for the given assembly and simply type the settings you need. Monodevelop does not have this feature (or at least I did not find it...)
What is the preferred way to do this under mono using monodevelop?
If the answer is "well, do the same - but hand-type the code needed" I'd love some pointers to a nice tutorial.
On the mono list, John Ludlow had the answer I needed:
...First, the ConfigurationManager ( http://msdn.microsoft.com/en-us/library/system.configuration.configurationmanager.aspx ) will expose two section handlers by default...
If you want more complex configuration option then you can define your own handlers by inheriting from ConfigurationSection and ConfigurationElement.
See http://msdn.microsoft.com/en-us/library/system.configuration.configurationsection.aspx and http://msdn.microsoft.com/en-us/library/system.configuration.configurationelement.aspx.
You may also need to provide a class inheriting from ConfigurationElementCollection as well, if you want to be able to configure a collection of values.
Thanks to John and the people of the mono-list.
You still can use .settings
files to keep settings, just edit them by-hand.
Also you can use App.config
/ another .config files
精彩评论