C# Class NAnt.Core.Util.ReflectionUtils

Provides a set of helper methods related to reflection.
显示文件 Open project: skolima/NAnt

Public Methods

Method Description
GetTypeFromString ( string typeName, bool throwOnError ) : Type

Loads the type specified in the type string with assembly qualified name.

If the Type cannot be instantiated from the assembly qualified type name, then we'll try to instantiate the type using its simple type name from an already loaded assembly with an assembly name mathing the assembly in the assembly qualified type name.

Private Methods

Method Description
ReflectionUtils ( ) : System

Initializes a new instance of the ReflectionUtils class.

Uses a private access modifier to prevent instantiation of this class.

Method Details

GetTypeFromString() public static method

Loads the type specified in the type string with assembly qualified name.
If the Type cannot be instantiated from the assembly qualified type name, then we'll try to instantiate the type using its simple type name from an already loaded assembly with an assembly name mathing the assembly in the assembly qualified type name.
/// is and /// an error is encountered while loading the , or /// is not an assembly qualified name. ///
public static GetTypeFromString ( string typeName, bool throwOnError ) : Type
typeName string The assembly qualified name of the type to load.
throwOnError bool Flag set to to throw an exception if the type cannot be loaded.
return System.Type