Instantiates an object given a class name.
Namespace: log4net.Util
Assembly: log4net (in log4net.dll) Version: 2.0.6.0-.NET 4.0
Syntax
public static Object InstantiateByClassName( string className, Type superClass, Object defaultValue )
Parameters
- className
- Type: SystemString
The fully qualified class name of the object to instantiate. - superClass
- Type: SystemType
The class to which the new object should belong. - defaultValue
- Type: SystemObject
The object to return in case of non-fulfillment.
Return Value
Type: ObjectAn instance of the className or defaultValue if the object could not be instantiated.
Remarks
Checks that the className is a subclass of superClass. If that test fails or the object could not be instantiated, then defaultValue is returned.
See Also