|
Hi everyone, Maybe someone can help me on this one: what I'm trying to achieve - using Windsor - is to have the same interceptor type applied multiple times on the same component but with different parameters. I can do this: var c = new WindsorContainer(); c.Register(Component.For<MyClass>()); c.Register(Component.For<MyInterceptor>().LifeStyle.Transient); var h = c.Kernel.GetHandler(typeof (MyClass)); h.ComponentModel.Interceptors.Add(new InterceptorReference(typeof(MyInterceptor))); h.ComponentModel.Interceptors.Add(new InterceptorReference(typeof(MyInterceptor))); h.ComponentModel.Interceptors.Add(new InterceptorReference(typeof(MyInterceptor))); // three instances of MyInterceptor are created var mc = c.Resolve<MyClass>(); // each instance of the created interceptor receives one call to Intercept mc.DoSomething(); But of course, no parameters are passed to the interceptors. Is there any built in way to pass parameters to the interceptors on creation? I'm not afraid of extending the Castle code if necessary, but of course I ask beforehand. If a change is required, my idea is to add a dictionary to InterceptorReference that holds the arguments which are passed to the interceptor component on creation, just as it would be done when passing a dictionary to Resolve for extra parameters. Does this sound reasonable? Regards, Andre --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~--- |
- Passing arguments to interceptors Andre Loker
- Re: Passing arguments to interceptors Eric Hauser
- Re: Passing arguments to interceptors Andre Loker
- Re: Passing arguments to interceptors Ayende Rahien
- Re: Passing arguments to interceptors Andre Loker
- Re: Passing arguments to interceptors Andre Loker
- Re: Passing arguments to intercept... Andre Loker
- Re: Passing arguments to interceptors Andre Loker
- Re: Passing arguments to interceptors Andre Loker
