- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在查看我在 Reflector 中创建的枚举,并且有一个名为“value__”的公共(public)整数字段。
这个成员(member)的目的是什么?
对文档的链接或引用可以作为答案。
谷歌搜索很痛苦,因为“value__”正在返回“value”的点击量。
我已经搜索了近一个小时,只找到了下面的链接。其中大部分是不同网站上的同一篇文章。它们都展示了如何通过反射访问成员,但没有一个解释成员的用途。
error CS0076: The enumerator name 'value__' is reserved and cannot be used ... Only for an enum does it not allow us to use the reserved word value__ as it must be using the same word internally to keep track of the enum.
最佳答案
JIT 编译器需要一个值类型的定义来描述它在装箱时的布局。它们中的大多数都被嵌入到 mscorlib 中,例如 System.Int32。 enum 关键字允许您创建新的值类型。因此,编译器必须在元数据中为其提供定义。这就是您正在查看的内容。您将看到 ToString() 使用的每个枚举成员的静态字段。以及一个存储枚举值的实例字段名 value__。关键是这只存在于枚举值的盒装版本中。
关于.net - 我可以在 Reflector 中针对我的枚举看到的公共(public) "value__"字段的目的是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5214031/
今天在 powershell.com 上 http://powershell.com/cs/blogs/tips/archive/2011/04/26/dump-enumerations.aspx 我
我正在对声明的枚举进行一些检查,我想知道为什么 Int32 value__ 始终显示为每个声明的枚举中的第一个枚举成员,因为它是成员的类型而不是本身就是一个成员? 要测试的示例代码: [TestMet
什么 value__ 可能在这里? value__ MSN ICQ YahooChat GoogleTalk 我运行的代码很简单: namespace EnumReflection { enu
我正在查看我在 Reflector 中创建的枚举,并且有一个名为“value__”的公共(public)整数字段。 这个成员(member)的目的是什么? 对文档的链接或引用可以作为答案。 谷歌搜索很
我是一名优秀的程序员,十分优秀!