inversion of control - Property Inject an Array with Spring.Net -


I am using the Spring.Net IoC container and type it in IList and Even the IList & lt; T & gt; But I'm a little stumped on how to inject a type of property string [] .

A defined in XSD & lt; Array & gt; Element and & lt; List & gt; & Lt; Price & gt;

>

As you can inject a string array as a comma delimited string (Not sure what syntax is necessary to avoid the actual commas in the strokes). In other words, your configuration will look something like this:

  & lt; Object id = "myobacter" type = "blah. Some class, blah" & gt; & Lt; Property Name = "StringAreProperty" value = "ABC, DF, Gone" /> & Lt; / Object & gt;  

Manually create a string [] also happens with the following syntax, if you need more complex (for example, if you want to personalize Values ​​are seeing some other reference instead of hard coding):

  & lt; Object id = "teststrakter" type = "string []" & gt; & Lt; Constructor - Arg Value = "3" /> & Lt; Property Name = "[0]" Value = "qwe" /> & Lt; Property Name = "[1]" Value = "AD" /> & Lt; Property Name = "[2]" Value = "zxc" /> & Lt; / Object & gt; & Lt; Object ID = "MyObject" type = "Blah, some class, Blah" & gt; & Lt; Property Name = "StringAreproperty" Riff = "Teststrator" /> & Lt; / Object & gt;  

Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -