Creating a plugin configuration architecture

J

Jens Weiermann

Hi!

I want to create something like a "plugin" like architecture for my
application. My question regards the configuration of these plugins - I
want all to be done in an xml file (optimally the app.config file). It
should look like this:

<triggers>
<trigger name="Timer1" type="Sensaction.TimerTrigger, Sensaction"
interval="1000"/>
<trigger name="FileSystemWatcher1"
type="Sensaction.FileSystemWatcherTrigger, Sensaction" baseDir="C:\Temp"/>
<trigger name="EventLogWatcher1" type="Sensaction.EventLogTrigger,
Sensaction" source="System"/>
</triggers>

etc.

That is, it can have any number of triggers of classes only available at
runtime. The properties of these objects are to be set by attributes of the
xml nodes.

I need my app to instantiate each of the triggers and set it's properties.

Of course, I don't want to re-invent the wheel and use as much of the
standard configuration functions as possible. However, having an unknown
number of elements doesn't seem to be covered by the framework.

I would appreciate any starters you can give me...

Jens
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top