Type ReadFieldOrPropType(StringBuilder sb, ByteReader br, out string typeName)
{
const byte ELEMENT_TYPE_BOOLEAN = 0x02;
const byte ELEMENT_TYPE_CHAR = 0x03;
const byte ELEMENT_TYPE_I1 = 0x04;
const byte ELEMENT_TYPE_U1 = 0x05;
const byte ELEMENT_TYPE_I2 = 0x06;
const byte ELEMENT_TYPE_U2 = 0x07;
const byte ELEMENT_TYPE_I4 = 0x08;
const byte ELEMENT_TYPE_U4 = 0x09;
const byte ELEMENT_TYPE_I8 = 0x0a;
const byte ELEMENT_TYPE_U8 = 0x0b;
const byte ELEMENT_TYPE_R4 = 0x0c;
const byte ELEMENT_TYPE_R8 = 0x0d;
const byte ELEMENT_TYPE_STRING = 0x0e;
const byte ELEMENT_TYPE_SZARRAY = 0x1d;
typeName = null;
switch (br.ReadByte())
{
case ELEMENT_TYPE_BOOLEAN:
return typeofSystemBoolean;
case ELEMENT_TYPE_CHAR:
return typeofSystemChar;
case ELEMENT_TYPE_I1:
return typeofSystemSByte;
case ELEMENT_TYPE_U1:
return typeofSystemByte;
case ELEMENT_TYPE_I2:
return typeofSystemInt16;
case ELEMENT_TYPE_U2:
return typeofSystemUInt16;
case ELEMENT_TYPE_I4:
return typeofSystemInt32;
case ELEMENT_TYPE_U4:
return typeofSystemUInt32;
case ELEMENT_TYPE_I8:
return typeofSystemInt64;
case ELEMENT_TYPE_U8:
return typeofSystemUInt64;
case ELEMENT_TYPE_R4:
return typeofSystemSingle;
case ELEMENT_TYPE_R8:
return typeofSystemDouble;
case ELEMENT_TYPE_STRING:
return typeofSystemString;
case ELEMENT_TYPE_SZARRAY:
return ReadFieldOrPropType(sb, br, out typeName).MakeArrayType();
case 0x55:
return ReadType(br, out typeName);
case 0x50:
return typeofSystemType;
case 0x51:
return typeofSystemObject;
default:
throw new Managed.Reflection.BadImageFormatException();
}
}