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); }
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; }