简体   繁体   中英

Can I specify to Castle Windsor which virtual methods to override in a class proxy?

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.

  1. If you want to proxy just one method, use IProxyHook to pick which method you want to proxy.
  2. If you're modifying ComponentModel (and adding interceptors or proxy hooks is one such operation) use IContributeComponentModelConstruction s for that. See the docs for more in depth explanation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM