Open sandboxFocus

Method GetType

GetType(Type)

Gets an IType given a reflection Type.

Declaration
public static IType GetType(Type type)
Parameters
Type Name Description
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
string typeName
Returns
Type Description
INamedType
Remarks

For nested types, this means using +, e.g. to get 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, params 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