Mark,

  That example uses an older approach to registration.  You might want to
try the fluent interface which give you more control.  If not, you need to
register your component as you are doing and the do a
kernel.RegisterCustomDependencies("component name", new { someArray = new []
{ "a", "b", "c" })

On Mon, Oct 6, 2008 at 7:41 AM, Mark Jensen <[EMAIL PROTECTED]> wrote:

>
> hmm.. maybe.. But i dont have any methods on Component?
>
> atm i trying to make a working example from this here
>
> http://dotnetslackers.com/articles/designpatterns/InversionOfControlAndDependencyInjectionWithCastleWindsorContainerPart1.aspx
>
> # IKernel kernel = new DefaultKernel();
> #
> # kernel.AddComponent("HttpFileDownloader", typeof(IFileDownloader),
> typeof(HttpFileDownloader));
> # kernel.AddComponent("StringParsingTitleScraper",
> typeof(ITitleScraper), typeof(StringParsingTitleScraper));
> # kernel.AddComponent("HtmlTitleRetriever",
> typeof(HtmlTitleRetriever));
> #
> # HtmlTitleRetriever retriever = (HtmlTitleRetriever)
> kernel[typeof(HtmlTitleRetriever)];
>
>
>
> On Oct 6, 2:19 pm, "Craig Neuwirt" <[EMAIL PROTECTED]> wrote:
> > Most everything in a config file can be done programatically.
> >
> > It sounds like you want to do something like
> >
> > kernel.Register(Component.For<IService>().ImplementBy<MyService>()
> >    .DependsOn(new { someArray = new [] { "a", "b", "c" } }
> >     );
> >
> > On Mon, Oct 6, 2008 at 4:42 AM, Mark Jensen <[EMAIL PROTECTED]> wrote:
> >
> > > Hi
> >
> > > I got a question about the Microkernel
> >
> > > I know that you can parse arrays when you are using a config file
> >
> > >http://www.castleproject.org/container/documentation/v1rc3/usersguide.
> ..
> >
> > > but i cant find a way to do the same thing with code....
> >
> > > is it even possible? .... and how could it be done, because i dont
> > > wont to keep these "settings" in a config file...
> >
> > > best regards,
> > > Mark j
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to