afaik you can do that with the commission/decommission support. Check
the source code for the startable facility for inspiration.

https://github.com/castleproject/Windsor/tree/master/src/Castle.Windsor/Facilities/Startable


On Tue, May 5, 2015 at 9:44 AM, Cathal McHale <cathal.mch...@gmail.com> wrote:
> Is it possible to assign an OnCreate action for a dependency after it has
> already registered?
>
> Scenario:
> I have a dependency that gets registered by the bootstrapper of assembly B.
> - The interface (dependency type) is public, but the implementation is
> internal to assembly B.
>
> I want assembly A to call "Init" on this dependency when it's created.
>
> Obviously I could do (in the startup code of assembly A):
> var factory = container.Resolve<IMyFactory>();
> factory.Init(config);
>
> However, I'd be nicer if the startup code didn't have to immediately resolve
> this dependency and could rather ask the container for the registration and
> then add to it (assign an OnCreate action).
>
> --
> You received this message because you are subscribed to the Google Groups
> "Castle Project Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to castle-project-users+unsubscr...@googlegroups.com.
> To post to this group, send email to castle-project-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/castle-project-users.
> For more options, visit https://groups.google.com/d/optout.



-- 
Cheers,
hammett
http://www.d-collab.com/
http://www.hammettblog.com/

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to castle-project-users+unsubscr...@googlegroups.com.
To post to this group, send email to castle-project-users@googlegroups.com.
Visit this group at http://groups.google.com/group/castle-project-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to