|
|
|
@ -28,7 +28,8 @@ namespace ICSharpCode.Decompiler.Ast
@@ -28,7 +28,8 @@ namespace ICSharpCode.Decompiler.Ast
|
|
|
|
|
{ |
|
|
|
|
None = 0, |
|
|
|
|
IncludeNamespace = 1, |
|
|
|
|
IncludeTypeParameterDefinitions = 2 |
|
|
|
|
IncludeTypeParameterDefinitions = 2, |
|
|
|
|
DoNotUsePrimitiveTypeNames = 4 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public class AstBuilder : ICodeMappings |
|
|
|
@ -462,39 +463,42 @@ namespace ICSharpCode.Decompiler.Ast
@@ -462,39 +463,42 @@ namespace ICSharpCode.Decompiler.Ast
|
|
|
|
|
return new PrimitiveType("dynamic"); |
|
|
|
|
} else { |
|
|
|
|
if (ns == "System") { |
|
|
|
|
switch (name) { |
|
|
|
|
case "SByte": |
|
|
|
|
return new PrimitiveType("sbyte"); |
|
|
|
|
case "Int16": |
|
|
|
|
return new PrimitiveType("short"); |
|
|
|
|
case "Int32": |
|
|
|
|
return new PrimitiveType("int"); |
|
|
|
|
case "Int64": |
|
|
|
|
return new PrimitiveType("long"); |
|
|
|
|
case "Byte": |
|
|
|
|
return new PrimitiveType("byte"); |
|
|
|
|
case "UInt16": |
|
|
|
|
return new PrimitiveType("ushort"); |
|
|
|
|
case "UInt32": |
|
|
|
|
return new PrimitiveType("uint"); |
|
|
|
|
case "UInt64": |
|
|
|
|
return new PrimitiveType("ulong"); |
|
|
|
|
case "String": |
|
|
|
|
return new PrimitiveType("string"); |
|
|
|
|
case "Single": |
|
|
|
|
return new PrimitiveType("float"); |
|
|
|
|
case "Double": |
|
|
|
|
return new PrimitiveType("double"); |
|
|
|
|
case "Decimal": |
|
|
|
|
return new PrimitiveType("decimal"); |
|
|
|
|
case "Char": |
|
|
|
|
return new PrimitiveType("char"); |
|
|
|
|
case "Boolean": |
|
|
|
|
return new PrimitiveType("bool"); |
|
|
|
|
case "Void": |
|
|
|
|
return new PrimitiveType("void"); |
|
|
|
|
case "Object": |
|
|
|
|
return new PrimitiveType("object"); |
|
|
|
|
if ((options & ConvertTypeOptions.DoNotUsePrimitiveTypeNames) |
|
|
|
|
!= ConvertTypeOptions.DoNotUsePrimitiveTypeNames) { |
|
|
|
|
switch (name) { |
|
|
|
|
case "SByte": |
|
|
|
|
return new PrimitiveType("sbyte"); |
|
|
|
|
case "Int16": |
|
|
|
|
return new PrimitiveType("short"); |
|
|
|
|
case "Int32": |
|
|
|
|
return new PrimitiveType("int"); |
|
|
|
|
case "Int64": |
|
|
|
|
return new PrimitiveType("long"); |
|
|
|
|
case "Byte": |
|
|
|
|
return new PrimitiveType("byte"); |
|
|
|
|
case "UInt16": |
|
|
|
|
return new PrimitiveType("ushort"); |
|
|
|
|
case "UInt32": |
|
|
|
|
return new PrimitiveType("uint"); |
|
|
|
|
case "UInt64": |
|
|
|
|
return new PrimitiveType("ulong"); |
|
|
|
|
case "String": |
|
|
|
|
return new PrimitiveType("string"); |
|
|
|
|
case "Single": |
|
|
|
|
return new PrimitiveType("float"); |
|
|
|
|
case "Double": |
|
|
|
|
return new PrimitiveType("double"); |
|
|
|
|
case "Decimal": |
|
|
|
|
return new PrimitiveType("decimal"); |
|
|
|
|
case "Char": |
|
|
|
|
return new PrimitiveType("char"); |
|
|
|
|
case "Boolean": |
|
|
|
|
return new PrimitiveType("bool"); |
|
|
|
|
case "Void": |
|
|
|
|
return new PrimitiveType("void"); |
|
|
|
|
case "Object": |
|
|
|
|
return new PrimitiveType("object"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|