显式接口实现和 Reflection.Emit

发布于 2024-08-12 17:59:54 字数 41 浏览 1 评论 0原文

有谁知道如何显式实现接口的属性 使用Reflection.Emit?

Does anybody know how to implement an interface's property explicitly
using Reflection.Emit?

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

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

发布评论

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

评论(2

韶华倾负 2024-08-19 17:59:54

请参阅 MSDN 文档,了解 TypeBuilder.DefineMethodOverride,其中包括使用 Reflection.Emit 生成使用该方法的显式接口实现的示例。

See the MSDN documentation for TypeBuilder.DefineMethodOverride, which includes an example of using Reflection.Emit to generate an explicit interface implementation using that method.

暮色兮凉城 2024-08-19 17:59:54

这个 Reflector Addin 应该可以帮助您。它将给定方法的 IL 代码转换为使用 System.Reflection.Emit 生成相同 IL 代码所需的 C# 代码。

This Reflector Addin should help you. It translates the IL code of a given method into the C# code that would be needed to generate the same IL code using System.Reflection.Emit.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文