|
Enhanced C#
Loyc library documentation
|
.NET Framework reflection doesn't offer complete type names for generic types such as "List<int>" (the Type.Name value of that class is "List`1"). Get fills in the gap, and also saves the computed name for fast repeated lookups.
More...
.NET Framework reflection doesn't offer complete type names for generic types such as "List<int>" (the Type.Name value of that class is "List`1"). Get fills in the gap, and also saves the computed name for fast repeated lookups.
Static Public Member Functions | |
| static string | Get (Type?type) |
| Computes a short language-agnostic name for a type, including generic parameters, e.g. GenericName(typeof(int)) is "Int32"; GenericName(typeof(Dictionary<int, string>)) is "Dictionary<Int32, String>". More... | |
| static string | NameWithGenericParams (this Type t) |
|
inlinestatic |
Computes a short language-agnostic name for a type, including generic parameters, e.g. GenericName(typeof(int)) is "Int32"; GenericName(typeof(Dictionary<int, string>)) is "Dictionary<Int32, String>".
| type | Type whose name you want |
The result is memoized, so that the name is computed only once.
1.8.7