[Mono-list] What is the preferred way to configure a mono application

John Ludlow john.ludlow.uk at gmail.com
Thu Feb 24 07:27:51 EST 2011


On 24 February 2011 10:43, John Ludlow <john.ludlow.uk at gmail.com> wrote:

> Hi,
>
> When I faced a similar issue, I came at it from a slightly different angle.
>  First, the ConfigurationManager (
> http://msdn.microsoft.com/en-us/library/system.configuration.configurationmanager.aspx)
> will expose two section handlers by default - ConnectionStrings (for
> database connections) and AppSettings (for general settings).
>
> 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.
>
> Hope that helps
>
> John
>
> On 24 February 2011 06:16, Abe Gillespie <abe.gillespie at gmail.com> wrote:
>
>> Wow, I have never used that feature.  Learn something new every day ...
>>
>> In any case, VS simply generates a Settings class and an accompanying
>> XML file from/to that settings are read/written.  Why not generate the
>> files in VS and then inspect the source files and reverse engineer
>> them?  The Settings class inherits from ApplicationSettingsBase and
>> really gets all its functionality there.  All you really need to do is
>> understand the XML in the Settings file.
>>
>> -Abe
>>
>> On Thu, Feb 24, 2011 at 12:31 AM, Nils Andresen <nils at nils-andresen.de>
>> wrote:
>> > When using VisualStudio, the preferred way to store 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. ;-)
>> >
>> > Yours,
>> > Nils
>> >
>> >
>> > _______________________________________________
>> > Mono-list maillist  -  Mono-list at lists.ximian.com
>> > http://lists.ximian.com/mailman/listinfo/mono-list
>> >
>> >
>> _______________________________________________
>> Mono-list maillist  -  Mono-list at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-list
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20110224/4c918987/attachment.html 


More information about the Mono-list mailing list