c# - Castle.Windsor: passing a dependency through 2 typed factories -


types:

public interface iwidgetfactoryfactory { iwidgetfactory createfactory(); }   public interface iwidgetfactory { foowidget createfoo(foo model); }  public class foowidget(icontextualservice service, foo model) { } 

registration:

component.for<iwidgetfactoryfactory>()          .asfactory(),  // customfactorycomponentselector unnecessary discussion, know  // it's there component.for<iwidgetfactory>()          .asfactory(c => c.selectedwith<customfactorycomponentselector>()), 

question:

what want able add method iwidgetfactoryfactory take icontextualservice:

iwidgetfactory createfactory(icontextualservice service); 

and create factory proxy such when call iwidgetfactory.createfoo resolves icontextualservice dependency parameter passed via new createfactory method.

note creating , calling multiple iwidgetfactoryfactory.createfactory(icontextualservice) in different contexts, , want each icontextualservice reflect context called in , passed from.

are there ideas on how done?

update: there related thread on castle-dev mailing list on issue.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -