当我尝试在使用XML配置时尝试将字符串数组传递到构造函数参数列表中时,我似乎无法获得统一的工作。将字符串或字符串数组传递到Unity注入构造函数中(基于配置)
当我尝试以下方法:
<typeConfig ...>
<constructor ...>
<param ... parameterType="System.String[]">
<array>
<value.../>
<value.../>
</array>
</param>
</constructor>
</typeConfig>
的c'tor它看起来像这样:
void Foo(string[] inputParams_){ ... }
它总是在Unity的FindConstructor(...)方法,说明失败,它不能找到一个c'tor mathcing参数类型的String.String
有谁知道如何将一串刺激成功地传递到这种类型的c'tor?如果不是,如果c'tor要接受IList,我该如何使用字符串列表来做到这一点?
谢谢!
嗯,不知道会尝试,但system.string犯规要求其他地方的资格 – miguel 2010-05-01 11:04:17