C# Class Orc.DataStructures.AList.Utilities.MemoizedTypeName

.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"). GetGenericName fills in the gap, and also saves the computed name for fast repeated lookups.
ファイルを表示 Open project: Orcomp/Orcomp

Public Methods

Method Description
GetGenericName ( Type type ) : string

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

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

NameWithGenericParams ( this t ) : string

Extension method on Type that is an alias for the ShortName method.

Private Methods

Method Description
ComputeGenericName ( Type type ) : string

Computes a type's name without memoization.

Method Details

GetGenericName() public static method

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>".
The result is memoized for generic types, so that the name is computed only once.
public static GetGenericName ( Type type ) : string
type System.Type Type whose name you want
return string

NameWithGenericParams() public static method

Extension method on Type that is an alias for the ShortName method.
public static NameWithGenericParams ( this t ) : string
t this
return string