Class ObjectFactory
Helper class for dynamically creating objects.
Inheritance
System.Object
ObjectFactory
Namespace: Sdl.Core.PluginFramework
Assembly: Sdl.Core.PluginFramework.dll
Syntax
public class ObjectFactory : Object
Constructors
ObjectFactory()
Declaration
public ObjectFactory()
Methods
CreateObject<T>(String)
Creates an oject of the specified type.
Declaration
public static T CreateObject<T>(string typeName)
where T : class
Parameters
Type | Name | Description |
---|---|---|
System.String | typeName | The name of the type to instantiate. |
Returns
Type | Description |
---|---|
T | The newly created object. |
Type Parameters
Name | Description |
---|---|
T | The requested object type. |
Exceptions
Type | Condition |
---|---|
System.InvalidCastException | When the newly created object is not of the requested type T. |