Beispiel #1
0
        public static bool TryGetPrimitiveElementType(TypeDefinition type, out ElementType etype)
        {
            etype = ElementType.None;
            if (type.Namespace != "System")
            {
                return(false);
            }
            Row <ElementType, bool> row;

            if (MetadataSystem.TryGetPrimitiveData(type, out row) && row.Col1.IsPrimitive())
            {
                etype = row.Col1;
                return(true);
            }
            return(false);
        }
Beispiel #2
0
        public static void TryProcessPrimitiveTypeReference(TypeReference type)
        {
            if (type.Namespace != "System")
            {
                return;
            }
            IMetadataScope scope = type.scope;

            if (scope == null || scope.MetadataScopeType != MetadataScopeType.AssemblyNameReference)
            {
                return;
            }
            Row <ElementType, bool> row;

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