哪些C#类型名称很特殊? [英] Which C# type names are special?

查看:52
本文介绍了哪些C#类型名称很特殊?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在输入内容下 IsSpecialName 返回真吗?从我的简要研究中,我发现属性访问器和运算符重载具有特殊名称,以及带有下划线的任何类型的名称.谁能给我完整说明类型名称特殊的情况?

Under what inputs does IsSpecialName return true? From my brief research I've found that property accessors and operator overloads have special names, alongside any type with a name which contains an underscore. Can anyone give me a complete description of cases in which a type name is special?

推荐答案

ECMA-335中发布的CLI规范是此类信息的不错来源.在文档中搜索 rtspecialname (CLR专用的名称)和 specialname (工具专用的名称.rtspecialnames的specialname属性已打开.:

The CLI specification as published in ECMA-335 is a decent source for info like this. Search the document for rtspecialname (names that are special to the CLR) and specialname (names that are special to tools. The specialname attribute is turned on for rtspecialnames. Giving these hits:

  • 枚举类型的基础 value __ 字段
  • 属性的getter和setter访问器方法
  • 事件的添加,删除和触发访问器方法
  • 操作员超载
  • 类的 .ctor 方法,构造方法
  • 类的 .cctor 方法,静态构造函数
  • The underlying value__ field of an enumerated type
  • The getter and setter accessor methods of a property
  • The add, remove and fire accessors methods of an event
  • Operator overloads
  • The .ctor method of a class, the constructor
  • The .cctor method of a class, the static constructor

这篇关于哪些C#类型名称很特殊?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆