ReflectorResolveType(TypeName, FuncTypeName, Type, ResolveTypeOptions) Method

Gets the Type with the specified typeName using the specified typeResolver.

Definition

Namespace: KGySoft.Reflection
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.5.0
C#
[CLSCompliantAttribute(false)]
public static Type? ResolveType(
	TypeName typeName,
	Func<TypeName, Type?>? typeResolver,
	ResolveTypeOptions options = ResolveTypeOptions.TryToLoadAssemblies|ResolveTypeOptions.AllowPartialAssemblyMatch
)

Parameters

typeName  TypeName
A pre-parsed TypeName instance with or without assembly name.
typeResolver  FuncTypeName, Type
If not , then will be called for every generic type definition and ultimate element types occur in typeName. The AssemblyName property in the TypeName argument can be if no assembly is specified for the type to resolve. Can return to let the default resolve logic take over based on options.
options  ResolveTypeOptions  (Optional)
The options for resolving the type. This parameter is optional.
Default value: TryToLoadAssemblies, AllowPartialAssemblyMatch.

Return Value

Type
The resolved Type, or if the ThrowError flag is not enabled in options and typeName could not be resolved with the provided options.

Remarks

typeName can be generic and may contain fully or partially defined assembly names.

See Also