MetalamaAPI documentationAspect APIMetalama.​Framework.​CodeType­FactoryGet­Type
Open sandboxFocus

Method GetType

GetType(Type)

Gets an IType given a reflection System.Type.

Declaration
public static IType GetType(Type type)
Parameters
Type Name Description
System.Type type
Returns
Type Description
IType

GetType(String)

Get type based on its full name, as used in reflection.

Declaration
public static INamedType GetType(string typeName)
Parameters
Type Name Description
System.String typeName
Returns
Type Description
INamedType
Remarks

For nested types, this means using +, e.g. to get System.Environment.SpecialFolder, use System.Environment+SpecialFolder.

For generic type definitions, this requires using </code>, e.g. to get <code>List<T></code>, use <code>System.Collections.Generic.List1.

Constructed generic types (e.g. List<int>) are not supported, for those, use WithTypeArguments(IMethod, IType[]).

GetType(SpecialType)

Gets a INamedType representing a given SpecialType.

Declaration
public static INamedType GetType(SpecialType type)
Parameters
Type Name Description
SpecialType type
Returns
Type Description
INamedType