TypeToCustomAttributeEncoding() private static method

private static TypeToCustomAttributeEncoding ( Type type ) : CustomAttributeEncoding
type Type
return CustomAttributeEncoding
コード例 #1
0
        private static CustomAttributeType InitCustomAttributeType(RuntimeType parameterType)
        {
            int num1 = (int)CustomAttributeData.TypeToCustomAttributeEncoding(parameterType);
            CustomAttributeEncoding attributeEncoding1 = CustomAttributeEncoding.Undefined;
            CustomAttributeEncoding attributeEncoding2 = CustomAttributeEncoding.Undefined;
            string str  = (string)null;
            int    num2 = 29;

            if (num1 == num2)
            {
                parameterType      = (RuntimeType)parameterType.GetElementType();
                attributeEncoding1 = CustomAttributeData.TypeToCustomAttributeEncoding(parameterType);
            }
            int num3 = 85;

            if (num1 == num3 || attributeEncoding1 == CustomAttributeEncoding.Enum)
            {
                attributeEncoding2 = CustomAttributeData.TypeToCustomAttributeEncoding((RuntimeType)Enum.GetUnderlyingType((Type)parameterType));
                str = parameterType.AssemblyQualifiedName;
            }
            int    num4     = (int)attributeEncoding1;
            int    num5     = (int)attributeEncoding2;
            string enumName = str;

            return(new CustomAttributeType((CustomAttributeEncoding)num1, (CustomAttributeEncoding)num4, (CustomAttributeEncoding)num5, enumName));
        }
コード例 #2
0
        // Token: 0x06004416 RID: 17430 RVA: 0x000F97C4 File Offset: 0x000F79C4
        private static CustomAttributeType InitCustomAttributeType(RuntimeType parameterType)
        {
            CustomAttributeEncoding customAttributeEncoding  = CustomAttributeData.TypeToCustomAttributeEncoding(parameterType);
            CustomAttributeEncoding customAttributeEncoding2 = CustomAttributeEncoding.Undefined;
            CustomAttributeEncoding encodedEnumType          = CustomAttributeEncoding.Undefined;
            string enumName = null;

            if (customAttributeEncoding == CustomAttributeEncoding.Array)
            {
                parameterType            = (RuntimeType)parameterType.GetElementType();
                customAttributeEncoding2 = CustomAttributeData.TypeToCustomAttributeEncoding(parameterType);
            }
            if (customAttributeEncoding == CustomAttributeEncoding.Enum || customAttributeEncoding2 == CustomAttributeEncoding.Enum)
            {
                encodedEnumType = CustomAttributeData.TypeToCustomAttributeEncoding((RuntimeType)Enum.GetUnderlyingType(parameterType));
                enumName        = parameterType.AssemblyQualifiedName;
            }
            return(new CustomAttributeType(customAttributeEncoding, customAttributeEncoding2, encodedEnumType, enumName));
        }