Class ObjectFactory
Helper class for dynamically creating objects.
Inherited Members
Namespace: Sdl.Core.PluginFramework
Assembly: Sdl.Core.PluginFramework.dll
Syntax
public class ObjectFactory
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 |
|---|---|---|
| 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 |
|---|---|
| InvalidCastException | When the newly created object is not of the requested type T. |