views:

123

answers:

1

config.ini:

[globalloads]
plugin.SWPlugin = 1
plugin.SWPlugin.params.1 = true
plugin.SWPlugin.params.2 = 10

[testz : globballoads]
plugin.SWPlugin.params.2 = 20
plugin.SWAnotherPlugin = 1

Simple enough?

// load testz config and programmatically create this equivalent code:
SWPluginAbstract p = new SWPlugin(true, 20);
// go thru the loop and load the other plugin too
SWPluginAbstract p = new SWAnotherPlugin();

If a different config.ini setup is needed to do that, it's not a problem... I suspect I will need to use a reflection class of some sort? I'm new to the whole .NET thing

A: 

The recommended mechanism for storing settings is to define custom ConfigurationSection's w/ custom elements and collections. These can then be stored in machine.config, app.config and a few other places.

The easiest way to make these is with a Visual Studio add-in called "Configuration Section Designer" on CodePlex.com.

It's visual and does a good job of making configuration sections.

Ah I was looking for a more simple interface for people using the program with limited computer programming experience able to drop a line in there to autoload the plugins and such. It's not really a program you run more than once with the same settings, so saving and loading them any other way than from something simple like an .ini is not, er.. desired.
Joshua