I have this "multiple site" component which keeps a list of "sites". The
"sites" are configured as components and the "multple site" is component
with an array parameter. I thought I could reference the "single sites" for
the array using the ${componentid} construct.
But a Castle.MicroKernel.SubSystems.Conversion.ConverterException is always
thrown when I resolve my "multiple site". I can get it to work by adding a
ITypeConverter but I strongly feel I'm doing something wrong.
What am I doing wrong? (code excerpts below)
Thanks
/Cristian
The class:
namespace CastleWindsorTest
{
public class MultipleSite : ISite
{
public MultipleSite(Site[] sites)
...
The configuration:
<component id="site" service="CastleWindsorTest.ISite,
CastleWindsorTest" type="CastleWindsorTest.Site, CastleWindsorTest">
<parameters>
<RootPage>666</RootPage>
</parameters>
</component>
<component id="site2" service="CastleWindsorTest.ISite,
CastleWindsorTest" type="CastleWindsorTest.Site, CastleWindsorTest">
<parameters>
<RootPage>42</RootPage>
</parameters>
</component>
<component id="multipleSite" service="CastleWindsorTest.ISite,
CastleWindsorTest" type="CastleWindsorTest.MultipleSite, CastleWindsorTest">
<parameters>
<sites>
<array>
<item>${site}</item>
<item>${site2}</item>
</array>
</sites>
</parameters>
</component>
_________________________________________________________________
Vårens klädmode på MSN http://salongk.msn.se/
--
Cheers,
hamilton verissimo
ham...@castlestronghold.com
http://www.castlestronghold.com/
Hammet, just to make sure I'm understanding you. One of the things I like
the most about windsor was that I can configure my services/classes right
were they are defined. Will I run into trouble doing this throughout?
Now, in case anyone is interested in why I'm seeing the "sites" as
components. I have this service, "ISite", that that knows which page is the
root page (and eventually other stuff as well). In certain installations I'd
like to change my "default site" implementation with a "multiple site"
implementation that does stuff depending on the domain name. Since the
"default site" implementation already has all I need, and I don't want to
make any xml parsing, I'm adding other sites in my "multiple site". Any
criticism is of course very welcome.
Thanks,
Cristian
_________________________________________________________________
Kolla in coola trailern till Die Hard 4
http://specials.se.msn.com/diehard4/default.aspx