How to read / enable properties from Castle Windsor configuration

I have many xml lock configurations where properties such as connectionstring are also stored in .Net configuration sections.

I would like to be able to read properties using a container, but cannot see the mechanism for this.

ie

<castle>
  <configuration>
    <properties>
      <connectionString>Data Source=MyServer;Initial Catalog=YadaYada;User      ID=me;Password=IAmGod</connectionString>
     </properties>
    <components>

...

Obviously, properties exist because they have component dependencies. I can resolve components, but not properties.

Of course, I could add the component just to read the property lock that it introduced, or I could wrap all the properties in a component specialized just to store name / vali pairs. But I would think that there is a simple container.resolve entry ("property.connectionstring").

* Edit Not very good with markdown, the above was intended for the xml section.

+5
2

- , windsor ( , , , , ). , . , / windsor , .

, - ( ), .. , :

  • , IXmlProcessorEngine, AddProperty ( XmlElement) .
  • XmlProcessor ( , , DefaultXmlProcessorEngine, , ).
  • XmlInterpreter ProcessResource, XmlProcessor.
  • , , , , , XmlInterpreter XmlProcessor, .

, AFAIK , - , , , , , if/else .. , .

+2

?

, , , ConnectionString , - , :

<component type="SessionManager">
  <parameters>
    <connectionString>#{connectionString}</connectionString>
  </parameters>
</component>

, , - .

+1

All Articles