I have classes coded to parse configuration from a custom app.config using .NET system.configuration library.
It parses this:
<operations>
<add type="heres_a_type" parameters="parameter1, parameter2"/>
</operations>
I would like to continue to support the above type of configuration, but also support something like this:
<operations>
<add type="heres_a_type">
<parameters>param1, param2</parameters>
</add>
</operations>
Or maybe something like this:
<operations>
<add type="heres_a_type">
<parameters>
<add name="param1" value="param1"/>
</parameters>
</add>
</operations>
For when parameters are something more complex, or for readability purposes. I want to support both, so that configuration can be terse most of the time, and expanded out when necessary.
Is there a way to do this with System.Configuration?
I tried adding Type and Parameters a second time as Elements instead of attributes, and making both sets optional, but System.Configuration doesn't like me defining Type and Parameters twice (makes sense).