private string GetBaseTypeOutput(CodeTypeReference typeRef)
{
string baseType = typeRef.BaseType;
if (baseType.Length == 0)
{
return "VOID";
}
switch (baseType.ToLower(CultureInfo.InvariantCulture))
{
case "system.int16":
return "SHORT";
case "system.uint16":
return "WORD";
case "system.int32":
return "INT";
case "system.uint32":
return "DWORD";
case "system.int64":
return "INT64";
case "system.uint64":
return "UINT64";
case "system.string":
return "STRING";
case "system.char":
return "CHAR";
case "system.object":
return "OBJECT";
case "system.boolean":
return "LOGIC";
case "system.void":
return "VOID";
case "system.byte":
return "BYTE";
case "system.sbyte":
return "System.SByte";
case "system.single":
return "REAL4";
case "system.double":
return "REAL8";
case "system.decimal":
return "System.Decimal";
}
//
StringBuilder sb = new StringBuilder(baseType.Length + 10);
string str3 = typeRef.BaseType;
int startIndex = 0;
int start = 0;
for (int i = 0; i < str3.Length; i++)
{
switch (str3[i])
{
case '+':
case '.':
sb.Append(str3.Substring(startIndex, i - startIndex));
sb.Append('.');
i++;
startIndex = i;
break;
case '`':
{
sb.Append(str3.Substring(startIndex, i - startIndex));
i++;
int length = 0;
while (((i < str3.Length) && (str3[i] >= '0')) && (str3[i] <= '9'))
{
length = (length * 10) + (str3[i] - '0');
i++;
}
// Generic Type like System.Int`ValueType : so, ignore ValueType
if (length > 0)
{
sb.Append(this.BuildGenericArguments(typeRef.TypeArguments, start, length));
start += length;
if ((i < str3.Length) && ((str3[i] == '+') || (str3[i] == '.')))
{
sb.Append('.');
i++;
}
startIndex = i;
}
else
startIndex = str3.Length;
break;
}
}
}
if (startIndex < str3.Length)
{
sb.Append(str3.Substring(startIndex));
}
return sb.ToString();
}