MetalamaAPI documentationAspect APIMetalama.​Framework.​CodeType­Factory
Open sandboxFocus

TypeFactory Class

Exposes methods that return instances of the IType interface.

Inheritance
System.Object
TypeFactory
Namespace: Metalama.Framework.Code
Assembly: Metalama.Framework.dll
Syntax
[CompileTime]
public static class TypeFactory : Object

Methods

Name Description
GetType(SpecialType)

Gets a INamedType representing a given SpecialType.

GetType(String)

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

GetType(Type)

Gets an IType given a reflection System.Type.

MakeArrayType(IType, Int32)

Creates an array type from the current type.

MakePointerType(IType)

Creates an array type from the current type.

ToNonNullableType(INamedType)

Returns the non-nullable type from the current IDynamicType. If the current type is a non-nullable reference type, returns the current type. If current type represents a System.Nullable<> where T is a value-type type parameter, this method returns ITypeParameter. Otherwise, it returns an INamedType.

ToNonNullableType(IType)

Returns the non-nullable type from the current IType. If the current type is a non-nullable reference type, returns the current type. If the current type is a System.Nullable<>, i.e. a nullable value type, returns the underlying type.

ToNonNullableType(ITypeParameter)

Returns the non-nullable type from the current ITypeParameter. If the current type is a non-nullable reference type, returns the current type.

ToNonNullableType(IArrayType)

Returns the non-nullable type from the current IArrayType. If the current type is non-nullable, returns the current type.

ToNonNullableType(IDynamicType)

Returns the non-nullable type from the current IDynamicType. If the current type is non-nullable, returns the current type.

ToNullableType(INamedType)

Creates a nullable type from the current INamedType. If the current type is already nullable, returns the current type. If the type is a value type, returns a System.Nullable<> of this type.

ToNullableType(IType)

Creates a nullable type from the current IType. If the current type is already nullable, returns the current type. If the type is a value type, returns a System.Nullable<> of this type.

ToNullableType(IArrayType)

Creates a nullable type from the current IArrayType. If the current type is already nullable, returns the current type.

ToNullableType(IDynamicType)

Creates a nullable type from the current IDynamicType. If the current type is already nullable, returns the current type.