ReflectorResolveType(String, FuncAssemblyName, String, Type, ResolveTypeOptions) Method

Gets the Type with the specified typeName using the specified typeResolver.
See the Examples section of the ResolveType(String, ResolveTypeOptions) overload for details and some examples.

Definition

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

Parameters

typeName  String
The type name as a string representation.
typeResolver  FuncAssemblyName, String, Type
If not , then will be called for every generic type definition and ultimate element types occur in typeName. The passed AssemblyName 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.

typeName can contain generic parameter types in the format as they are returned by the TypeExtensions.GetName extension method.

See Also