Open sandboxFocus

Method TryGetTypeByReflectionName

TryGetTypeByReflectionName(string, out INamedType?)

Attempts to get a type based on its full name, as used in reflection.

Declaration
bool TryGetTypeByReflectionName(string reflectionName, out INamedType? namedType)
Parameters
Type Name Description
string reflectionName

The full name of the type in reflection format.

INamedType namedType

When this method returns, contains the INamedType if the type was found; otherwise, null.

Returns
Type Description
bool

true if the type was found; otherwise, false.

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(INamedType, params IType[]).