Verbal Description of Custom Attribute Value
Version 2.0 of the ILAsm compiler supports the verbal description of the custom attribute value blob. This makes reading and writing the custom attribute values quite a lot easier.
The definition of a serialized primitive type is similar to the definition of the fields’ and properties’ initialization values (see Chapter 9). For example, the value 0x1234 of an int32 parameter from the previous section is expressed as int32(0x1234). The values of Boolean parameters are expressed as bool(true) or bool(false).
The definition of a string begins with the keyword string, followed by the single-quoted string value in parentheses. For example, the string Common Language Runtime from the previous section would be represented as string('Common Language Runtime'). To express a null-reference string, the construct string(nullref)
is used.
The definition of the serialized types (instances of [mscorlib]System.Type) begins with the keyword type, followed either by the type name in ILAsm notation or by keyword class and the single-quoted class name in Reflection notation:
or
To express a null-reference type, the construct type(nullref) is used.
The definition of a boxed value of a primitive value type begins with the keyword object, followed by the definition of the primitive type in parentheses, such as object(int32(0x1234)).
The definition of an array contains the element count in square brackets and the space-delimited sequence of values in parentheses, such as
or
The definition of a name/value pair, denoting the initialization of a field or a property,begins with the keyword field or property, respectively, followed by the type of the field(property) and its name, followed by the equality symbol and the definition of the serialized initialization value as described previously. For example:
property string yyy = string('Hello World!')
property enum MyEnum yyy = int32(2)
All definitions of the serialized initialization values comprising the custom attribute value blob are written in space-delimited sequence and enclosed in curly braces.
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 周边上新:园子的第一款马克杯温暖上架
2006-11-18 SDA仪器检校流程控制