Мне нужен раздел конфигурации примерно так:
<myConfig>
<mySubConfig1>
<mySubSubConfig1 keyAttribute="value1">
<mySubSubConfig1Element keyAttribute="value1"/>
<mySubSubConfig1Element keyAttribute="value2"/>
</mySubSubConfig1>
<mySubSubConfig1 keyAttribute="value2">
<mySubSubConfig1Element keyAttribute="value1"/>
</mySubSubConfig1>
</mySubConfig1>
<mySubConfig2>
<mySubSubConfig2 keyAttribute="value1">
<mySubSubConfig2Element keyAttribute="value1"/>
<mySubSubConfig2Element keyAttribute="value2"/>
</mySubSubConfig2>
<mySubSubConfig2 keyAttribute="value2">
<mySubSubConfig2Element keyAttribute="value1"/>
</mySubSubConfig2>
</mySubConfig2>
<mySubConfig3>
<mySubSubConfig3 keyAttribute="value1">
<mySubSubConfig3Element keyAttribute="value1"/>
<mySubSubConfig3Element keyAttribute="value2"/>
</mySubSubConfig3>
<mySubSubConfig3 keyAttribute="value2">
<mySubSubConfig3Element keyAttribute="value1"/>
</mySubSubConfig3>
</mySubConfig3>
</myConfig>
Я еще не нашел волшебство, которое разрешило бы это с помощью старого IConfigurationSectionHandler
интерфейса. Кто-нибудь знает, как это сделать?
Хорошо, если myConfig
и mySubConfign
- ConfigurationSectionGroup
или ConfigurationSection
.
Кроме того, если это имеет значение, это будет использоваться из web.config.