代表们在哪里?构造函数和成员函数是如何定义的?
当我在 Reflector 中查看 Action
委托时,我看到它有一个类似的构造函数
public Action(object @object, IntPtr method);
,但我找不到相同的任何主体以及其他成员函数,例如 Invoke
, BeginInvoke
等。我只能看到它的定义。这些函数是在哪里定义的?它们是在 .net BCL 之外定义的吗?
When I was looking at the Action
delegates in Reflector, I saw it has a constructor like
public Action(object @object, IntPtr method);
But I could not find any body for the same along with other member functions like Invoke
, BeginInvoke
etc. I can only see the definitions for it. Where does these functions are defined? Are they defined outside of the .net BCLs?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
基本上,委托是由 CLR 专门处理的。编译器提供签名,但 CLR 知道如何处理它们。
ECMA-335 分区的第 8.9.3 节我谈到了这一点:
(VES 是虚拟执行系统;CLR 是 Microsoft 对 VES 的实现。)
Delegates are handled specially by the CLR, basically. The compiler provides the signatures, but the CLR knows what to do with them.
Section 8.9.3 of ECMA-335 partition I talks about this:
(VES is the Virtual Execution System; the CLR is Microsoft's implementation of the VES.)