I have many virtual methods in a class, but only one should be intercepted, Can I tell Castle Windsor to override only that method so I dont have to do validation in the Intercept 开发者_如何转开发method?
Edit:
I use the IKernelEvents.ComponentRegistered event to choose which types get the interceptor.
- If you want to proxy just one method, use
IProxyHook
to pick which method you want to proxy. - If you're modifying
ComponentModel
(and adding interceptors or proxy hooks is one such operation) useIContributeComponentModelConstruction
s for that. See the docs for more in depth explanation.
精彩评论