Enhanced C#
Loyc library documentation
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
Static Public Member Functions | List of all members
Loyc.MemoizedTypeName Class Reference

.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...


Source file:

Remarks

.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&lt;Int32, String>". More...
 
static string NameWithGenericParams (this Type t)
 

Member Function Documentation

static string Loyc.MemoizedTypeName.Get ( Type?  type)
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&lt;Int32, String>".

Parameters
typeType whose name you want
Returns
Name with generic parameters, as explained in the summary.

The result is memoized, so that the name is computed only once.