TryGetPrimitiveData() static private method

static private TryGetPrimitiveData ( TypeReference type, bool>.Row &primitive_data ) : bool
type TypeReference
primitive_data bool>.Row
return bool
コード例 #1
0
        public static bool TryGetPrimitiveElementType(TypeDefinition type, out ElementType etype)
        {
            Row <ElementType, bool> row;

            etype = ElementType.None;
            if (type.Namespace != "System")
            {
                return(false);
            }
            if (!MetadataSystem.TryGetPrimitiveData(type, out row) || !((ElementType)row.Col1).IsPrimitive())
            {
                return(false);
            }
            etype = row.Col1;
            return(true);
        }
コード例 #2
0
        public static void TryProcessPrimitiveTypeReference(TypeReference type)
        {
            Row <ElementType, bool> row;

            if (type.Namespace != "System")
            {
                return;
            }
            IMetadataScope metadataScope = type.scope;

            if (metadataScope == null || metadataScope.MetadataScopeType != MetadataScopeType.AssemblyNameReference)
            {
                return;
            }
            if (!MetadataSystem.TryGetPrimitiveData(type, out row))
            {
                return;
            }
            type.etype       = row.Col1;
            type.IsValueType = row.Col2;
        }