C# Class Spring.Core.TypeResolution.TypeResolver

Resolves a System.Type by name.
Inheritance: ITypeResolver
Datei anzeigen Open project: spring-projects/spring-net

Public Methods

Method Description
Resolve ( string typeName ) : Type

Resolves the supplied typeName to a System.Type instance.

Protected Methods

Method Description
BuildTypeLoadException ( string typeName ) : TypeLoadException

Creates a new TypeLoadException instance from the given typeName

BuildTypeLoadException ( string typeName, Exception ex ) : TypeLoadException

Creates a new TypeLoadException instance from the given typeName with the given inner Exception

Private Methods

Method Description
LoadTypeByIteratingOverAllLoadedAssemblies ( Spring.Core.TypeResolution.TypeAssemblyHolder typeInfo ) : Type

Uses M:System.AppDomain.CurrentDomain.GetAssemblies() to load the attendant System.Type referred to by the typeInfo parameter.

LoadTypeDirectlyFromAssembly ( Spring.Core.TypeResolution.TypeAssemblyHolder typeInfo ) : Type

Uses System.Reflection.Assembly.LoadWithPartialName(string) to load an System.Reflection.Assembly and then the attendant System.Type referred to by the typeInfo parameter.

System.Reflection.Assembly.LoadWithPartialName(string) is deprecated in .NET 2.0, but is still used here (even when this class is compiled for .NET 2.0); System.Reflection.Assembly.LoadWithPartialName(string) will still resolve (non-.NET Framework) local assemblies when given only the display name of an assembly (the behaviour for .NET Framework assemblies and strongly named assemblies is documented in the docs for the System.Reflection.Assembly.LoadWithPartialName(string) method).

Method Details

BuildTypeLoadException() protected static method

Creates a new TypeLoadException instance from the given typeName
protected static BuildTypeLoadException ( string typeName ) : TypeLoadException
typeName string
return System.TypeLoadException

BuildTypeLoadException() protected static method

Creates a new TypeLoadException instance from the given typeName with the given inner Exception
protected static BuildTypeLoadException ( string typeName, Exception ex ) : TypeLoadException
typeName string
ex System.Exception
return System.TypeLoadException

Resolve() public method

Resolves the supplied typeName to a System.Type instance.
/// If the supplied could not be resolved /// to a . ///
public Resolve ( string typeName ) : Type
typeName string /// The unresolved (possibly partially assembly qualified) name /// of a . ///
return System.Type