我可以向温莎城堡指定要在类代理中重写哪些虚拟方法吗?

发布于 2024-08-31 04:10:33 字数 161 浏览 3 评论 0原文

我在一个类中有很多虚拟方法,但只有一个应该被拦截,我可以告诉 Castle Windsor 仅重写该方法,这样我就不必在 Intercept 方法中进行验证吗?

编辑:

我使用 IKernelEvents.ComponentRegistered 事件来选择哪些类型获取拦截器。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

清泪尽 2024-09-07 04:10:33
  1. 如果您只想代理一种方法,请使用 IProxyHook 来选择您要代理的方法。
  2. 如果您要修改 ComponentModel(添加拦截器或代理挂钩就是此类操作之一),请使用 IContributeComponentModelConstruction请参阅文档以获取更深入的说明。
  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 IContributeComponentModelConstructions for that. See the docs for more in depth explanation.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文