寻找可能的 MethodAttributes.SpecialName 的确切列表

发布于 2024-09-25 03:30:27 字数 278 浏览 0 评论 0原文

我知道 ctorcctor、属性/索引器前缀:get_set_、事件管理前缀:<代码>添加_,<代码>删除_。 我曾见过一两次 raise_ 前缀(不记得在哪里)。

.Net 级别是否存在明确的列表(ECMA 规范)?如果是的话在哪里?

它是一个“开放列表”,以便任何(新)语言都可以根据其(未来)需求定义它们吗?

I am aware of ctor, cctor, property/indexer prefix: get_, set_, event management prefix: add_, remove_.
I have seen a raise_ prefix once or twice (do not remember where).

Does a definitive list exists at the .Net level (ECMA spec.)? If yes where is it?

Is it an "open list" so that any (new) language can define them for its (future) needs?

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

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

发布评论

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

评论(1

得不到的就毁灭 2024-10-02 03:30:27

用户定义的运算符是另一个例子。与 System.String.op_Equality (operator==) 一样:

.method public hidebysig specialname static bool op_Equality(string a, string b) cil managed
{
    .maxstack 8
    L_0000: ldarg.0 
    L_0001: ldarg.1 
    L_0002: call bool System.String::Equals(string, string)
    L_0007: ret 
}

没有详尽的列表,语言实现可以自由地使用该属性来隐藏其粘合性。例如,您可能会在 VB.NET 编译器使用 RaiseEvent 访问器生成的代码中看到 raise_ 前缀。

User defined operators would be another example. Like System.String.op_Equality (operator==):

.method public hidebysig specialname static bool op_Equality(string a, string b) cil managed
{
    .maxstack 8
    L_0000: ldarg.0 
    L_0001: ldarg.1 
    L_0002: call bool System.String::Equals(string, string)
    L_0007: ret 
}

There's no exhaustive list, language implementations are free to use the attribute to hide their glue. You probably saw the raise_ prefix on code generated by the VB.NET compiler using the RaiseEvent accessor for example.

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