Show / Hide Table of Contents

Interface ITypeLoadingProvider

Interface representing a reflection provider used to load System.Type objects.

Inherited Members
IComTypeLoadingProvider.GetTypeFromCLSID(Guid, String, Boolean)
IComTypeLoadingProvider.GetTypeFromProgID(String, String, Boolean)
Namespace: System.Reflection
Assembly: Nuqleon.Reflection.Virtualization.dll
Syntax
public interface ITypeLoadingProvider : IComTypeLoadingProvider

Methods

GetType(String, Boolean, Boolean)

Gets the System.Type with the specified name, specifying whether to perform a case-sensitive search and whether to throw an exception if the type is not found.

Declaration
Type GetType(string typeName, bool throwOnError, bool ignoreCase)
Parameters
Type Name Description
System.String typeName

The assembly-qualified name of the type to get. See System.Type.AssemblyQualifiedName. If the type is in the currently executing assembly or in Mscorlib.dll, it is sufficient to supply the type name qualified by its namespace.

System.Boolean throwOnError

true to throw an exception if the type cannot be found; false to return null.Specifying false also suppresses some other exception conditions, but not all of them. See the Exceptions section.

System.Boolean ignoreCase

true to perform a case-insensitive search for typeName, false to perform a case-sensitive search for typeName.

Returns
Type Description
System.Type

The type with the specified name. If the type is not found, the throwOnError parameter specifies whether null is returned or an exception is thrown. In some cases, an exception is thrown regardless of the value of throwOnError. See the Exceptions section.

GetType(String, Func<AssemblyName, Assembly>, Func<Assembly, String, Boolean, Type>, Boolean, Boolean)

Gets the type with the specified name, specifying whether to perform a case-sensitive search and whether to throw an exception if the type is not found, and optionally providing custom methods to resolve the assembly and the type.

Declaration
Type GetType(string typeName, Func<AssemblyName, Assembly> assemblyResolver, Func<Assembly, string, bool, Type> typeResolver, bool throwOnError, bool ignoreCase)
Parameters
Type Name Description
System.String typeName

The name of the type to get. If the typeResolver parameter is provided, the type name can be any string that typeResolver is capable of resolving. If the assemblyResolver parameter is provided or if standard type resolution is used, typeName must be an assembly-qualified name (see System.Type.AssemblyQualifiedName), unless the type is in the currently executing assembly or in Mscorlib.dll, in which case it is sufficient to supply the type name qualified by its namespace.

System.Func<System.Reflection.AssemblyName, System.Reflection.Assembly> assemblyResolver

A method that locates and returns the assembly that is specified in typeName. The assembly name is passed to assemblyResolver as an System.Reflection.AssemblyName object. If typeName does not contain the name of an assembly, assemblyResolver is not called. If assemblyResolver is not supplied, standard assembly resolution is performed. Caution Do not pass methods from unknown or untrusted callers. Doing so could result in elevation of privilege for malicious code. Use only methods that you provide or that you are familiar with.

System.Func<System.Reflection.Assembly, System.String, System.Boolean, System.Type> typeResolver

A method that locates and returns the type that is specified by typeName from the assembly that is returned by assemblyResolver or by standard assembly resolution. If no assembly is provided, the method can provide one. The method also takes a parameter that specifies whether to perform a case-insensitive search; the value of ignoreCase is passed to that parameter. Caution Do not pass methods from unknown or untrusted callers.

System.Boolean throwOnError

true to throw an exception if the type cannot be found; false to return null. Specifying false also suppresses some other exception conditions, but not all of them. See the Exceptions section.

System.Boolean ignoreCase

true to perform a case-insensitive search for typeName, false to perform a case-sensitive search for typeName.

Returns
Type Description
System.Type

The type with the specified name. If the type is not found, the throwOnError parameter specifies whether null is returned or an exception is thrown. In some cases, an exception is thrown regardless of the value of throwOnError. See the Exceptions section.

ReflectionOnlyGetType(String, Boolean, Boolean)

Gets the System.Type with the specified name, specifying whether to perform a case-sensitive search and whether to throw an exception if the type is not found. The type is loaded for reflection only, not for execution.

Declaration
Type ReflectionOnlyGetType(string typeName, bool throwIfNotFound, bool ignoreCase)
Parameters
Type Name Description
System.String typeName

The assembly-qualified name of the System.Type to get.

System.Boolean throwIfNotFound

true to throw a System.TypeLoadException if the type cannot be found; false to return null if the type cannot be found. Specifying false also suppresses some other exception conditions, but not all of them. See the Exceptions section.

System.Boolean ignoreCase

true to perform a case-insensitive search for typeName; false to perform a case-sensitive search for typeName.

Returns
Type Description
System.Type

The type with the specified name, if found; otherwise, null. If the type is not found, the throwIfNotFound parameter specifies whether null is returned or an exception is thrown. In some cases, an exception is thrown regardless of the value of throwIfNotFound. See the Exceptions section.

Extension Methods

ComTypeLoadingProviderExtensions.GetTypeFromCLSID(IComTypeLoadingProvider, Guid)
ComTypeLoadingProviderExtensions.GetTypeFromCLSID(IComTypeLoadingProvider, Guid, Boolean)
ComTypeLoadingProviderExtensions.GetTypeFromCLSID(IComTypeLoadingProvider, Guid, String)
ComTypeLoadingProviderExtensions.GetTypeFromProgID(IComTypeLoadingProvider, String)
ComTypeLoadingProviderExtensions.GetTypeFromProgID(IComTypeLoadingProvider, String, Boolean)
ComTypeLoadingProviderExtensions.GetTypeFromProgID(IComTypeLoadingProvider, String, String)
TypeLoadingProviderExtensions.GetType(ITypeLoadingProvider, String)
TypeLoadingProviderExtensions.GetType(ITypeLoadingProvider, String, Boolean)
TypeLoadingProviderExtensions.GetType(ITypeLoadingProvider, String, Func<AssemblyName, Assembly>, Func<Assembly, String, Boolean, Type>)
TypeLoadingProviderExtensions.GetType(ITypeLoadingProvider, String, Func<AssemblyName, Assembly>, Func<Assembly, String, Boolean, Type>, Boolean)
In This Article
Back to top Generated by DocFX