Exemplo n.º 1
0
 public static string FormatTypeForCSharp(Type type, bool useFullName)
 {
     if (type == (Type)null)
     {
         return(string.Empty);
     }
     if (TypeNameFormatter.CSharpPrettyNameLookup.ContainsKey(type))
     {
         return(TypeNameFormatter.CSharpPrettyNameLookup[type]);
     }
     if (type.IsGenericType)
     {
         return(TypeNameFormatter.CreateGenericTypeString(type, useFullName, "<", TypeNameFormatter.CSharpGenericArgumentFormatter, ">"));
     }
     return(TypeNameFormatter.CreateTypeString(type, useFullName));
 }
Exemplo n.º 2
0
 public static string FormatTypeForVisualBasic(Type type, bool useFullName)
 {
     if (type == (Type)null)
     {
         return(string.Empty);
     }
     if (TypeNameFormatter.VBPrettyNameLookup.ContainsKey(type))
     {
         return(TypeNameFormatter.VBPrettyNameLookup[type]);
     }
     if (type.IsGenericType)
     {
         return(TypeNameFormatter.CreateGenericTypeString(type, useFullName, "(", TypeNameFormatter.VBGenericArgumentFormatter, ")"));
     }
     return(TypeNameFormatter.CreateTypeString(type, useFullName));
 }