void AppendCATypeName(StringBuilder sb, Type type, string typeName, bool securityCompatHack = false)
{
if (type.IsArray)
{
AppendCATypeName(sb, type.GetElementType(), null);
sb.Append("[]");
}
else if (type == typeofSystemBoolean)
{
sb.Append("bool");
}
else if (type == typeofSystemSByte)
{
sb.Append("int8");
}
else if (type == typeofSystemByte)
{
sb.Append("uint8");
}
else if (type == typeofSystemChar)
{
sb.Append("char");
}
else if (type == typeofSystemInt16)
{
sb.Append("int16");
}
else if (type == typeofSystemUInt16)
{
sb.Append("uint16");
}
else if (type == typeofSystemInt32)
{
sb.Append("int32");
}
else if (type == typeofSystemUInt32)
{
sb.Append("uint32");
}
else if (type == typeofSystemInt64)
{
sb.Append("int64");
}
else if (type == typeofSystemUInt64)
{
sb.Append("uint64");
}
else if (type == typeofSystemSingle)
{
sb.Append("float32");
}
else if (type == typeofSystemDouble)
{
sb.Append("float64");
}
else if (type == typeofSystemString)
{
sb.Append("string");
}
else if (type == typeofSystemObject)
{
sb.Append("object");
}
else if (type.FullName == "System.Type" && type.Assembly.GetName().Name == "mscorlib")
{
sb.Append("type");
}
else
{
sb.Append("enum ");
AppendTypeName(sb, type, typeName, false, securityCompatHack);
}
}