3
我有以下幾點:
TypeUser:ITypeUser
{
公共TypeUser(類型usedType){..}
}castle windsor:如何在xml config中使用Type作爲構造函數屬性?
如何配置在溫莎配置XML類型參數?
我有以下幾點:
TypeUser:ITypeUser
{
公共TypeUser(類型usedType){..}
}castle windsor:如何在xml config中使用Type作爲構造函數屬性?
如何配置在溫莎配置XML類型參數?
對於自定義類型,您需要提供一個類型轉換器來處理,但是「類型」支持開箱即用的(如果你看看在list here on the castleproject site),並應「只是工作」,即像這樣的轉換:
<component id="myServer" service="SomeNameSpace.ITypeUser, SomeAssembly" type="SomeNameSpace.TypeUser, SomeLib">
<parameters>
<usedType>SomeNameSpace.MyOtherType, SomeAssembly</usedType>
</parameters>
</component>