How to use xml config to make an array of double?

Dec 18, 2008 at 2:15 PM
I have a very dumb question. How can I use the xml config to define an array element intialized with say double values? Thank you in advance!
Dec 18, 2008 at 2:28 PM

I figured it out for a 1 dimensional array but what about a 2 dimensional array?

 

<?

 

xml version="1.0" encoding="utf-8" ?>

 

<

 

configuration>

 

<

 

configSections>

 

<

 

section name="unity" type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection, Microsoft.Practices.Unity.Configuration" />

 

</

 

configSections>

 

<

 

unity>

 

<

 

typeAliases>

 

<

 

typeAlias alias="string" type="System.String, mscorlib" />

 

<

 

typeAlias alias="stringArray" type="System.String[], mscorlib" />

 

<

 

typeAlias alias="ArrayConstructor" type="CasimirWFConsole.TestClass, CasimirWFConsole" />

 

</

 

typeAliases>

 

<

 

containers>

 

<

 

container name="test">

 

<

 

instances>

 

<

 

add name="MyInstance1" type="string" value="Some value" />

 

<

 

add name="MyInstance2" type="string" value="Some value2" />

 

</

 

instances>

 

 

<

 

types>

 

<

 

type type="ArrayConstructor">

 

<

 

typeConfig >

 

<

 

constructor>

 

<

 

param name="Recovery" parameterType="stringArray">

 

<

 

array>

 

<

 

dependency name="MyInstance1"/>

 

<

 

dependency name="MyInstance2"/>

 

</

 

array>

 

</

 

param>

 

</

 

constructor>

 

</

 

typeConfig>

 

</

 

type>

 

</

 

types>

 

</

 

container>

 

</

 

containers>

 

</

 

unity>

 

</

 

configuration>

 

Dec 19, 2008 at 2:43 AM
Try this,

<typeAlias alias="stringArray" type="System.String[,], mscorlib" />

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com