Sorry for dropping off. Got super busy... What part of the code below is causing you the problem? I'm really tired, but trying to figure out a more elegant way to do this without knowing the type that is going to be resolved.
--- Patrick Steele http://weblogs.asp.net/psteele On Thu, Aug 23, 2012 at 10:27 AM, mynkow <[email protected]> wrote: > I have 3 assemblies. Each one has EventHandlers. Only one assembly will work > at the same time. > I have IEventBus and OnCreate method within component registration I > register only the event handlers from the active assembly; > > container.Register(Component.For<IEventBus>().ImplementedBy<InProcessEventBus>().OnCreate((kernel, > eventBus) => > { > (eventBus as > InProcessEventBus).RegisterAllHandlersInAssembly(Assembly.GetAssembly(typeof(IHaveEventHandlers)), > kernel.Resolve, kernel.ReleaseComponent); > > var loginProvider = container.Resolve<ILoginProvider>(); > > if (loginProvider.LoginProviderType == > LoginProvider.DB_LoginProvider) > (eventBus as > InProcessEventBus).RegisterAllHandlersInAssembly(Assembly.GetAssembly(typeof(IHaveDbLoginProviderEventHandlers)), > kernel.Resolve, kernel.ReleaseComponent); > else if (loginProvider.LoginProviderType == > LoginProvider.LDAP_LoginProvider) > (eventBus as > InProcessEventBus).RegisterAllHandlersInAssembly(Assembly.GetAssembly(typeof(IHaveLdapLoginProviderEventHandlers)), > kernel.Resolve, kernel.ReleaseComponent); > })); > > -- > You received this message because you are subscribed to the Google Groups > "Castle Project Users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/castle-project-users/-/KJ2m6R77yHcJ. > 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. -- 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.
