Enhanced C#
Language of your choice: 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) |
Extension method on Type that is an alias for the Get method. More... | |
|
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 for generic types, so that the name is computed only once.
Referenced by Loyc.MemoizedTypeName.NameWithGenericParams().
|
inlinestatic |
Extension method on Type
that is an alias for the Get method.
References Loyc.MemoizedTypeName.Get().