> There's a IProxyGenerationHook that does just that. > > check the bool ShouldInterceptMethod(Type type, MethodInfo memberInfo); method
You're right, I forgot about that. So IInterceptorSelector definitely can't do anything for us at code generation time. [...] > > You are basically repeating the Proceed method's implementation from Abstract > Invocation here. > Also, think about how SelectingInterceptor would be created? It would have to > be the only one interceptor in the proxy? > As I said... it's hackish, and adds complexity, not removes it. Now: var options = new ProxyGenerationOptions (); options.Selector = selector; X x = (X) generator.CreateClassProxy (typeof (X), options, myInterceptors); Then: var selectingInterceptor = new SelectingInterceptor (myInterceptors, selector); X x = (X) generator.CreateClassProxy (typeof (X), selectingInterceptor); Why is this hackish or adds complexity? I remove: - the requirement of a static or instance field (+ initialization) - the requirement of having IInterceptorSelector in the ProxyGenerationOptions (+ serialization, + Equals, + GetHashCode) Best regards, Fabian --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Castle Project Development List" 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-devel?hl=en -~----------~----~----~----~------~----~------~--~---
