zoukankan      html  css  js  c++  java
  • 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:

    type([OtherAsm2]MyNamespace.MyEnclosingClass/MyNestedClass)

    or

    type(class 'MyNamespace.MyEnclosingClass+MyNestedClass, OtherAssembly,Version=1.2.3.4,PublicKeyToken=0102030405060708, Culture=fr-CA')

       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

    int32[3](123 456 789)

    or

    string[4]('One' 'Two' 'Three' 'Four').

       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:

    field int32[] xxx = int32[3](1 2 3)
    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.

  • 相关阅读:
    [hihocoder-1974] 智能分包 状态压缩dp
    2018北京ICPC D. Frog and Portal 斐波那契数 构造
    [hdu-6621]K-th Closest Distance 主席树 线段树 2019 多校4
    [POJ 2104]K-th Number 主席树 可持久化线段树 入门
    [hdu-6623]Minimal Power of Prime
    [hdu-6608] Fansblog 威尔逊定理 质数的密度分布 2019 多校 3
    [codeforces1000F] One Occurrence
    [python] 机器学习 卷积神经网络 用迁移学习实现人脸识别
    [python] 安装TensorFlow问题 解决Cannot uninstall 'wrapt'. It is a distutils installed project
    浅谈getResource方法
  • 原文地址:https://www.cnblogs.com/Jax/p/1336122.html
Copyright © 2011-2022 走看看