Class DefaultInstanceActivator
Default instance activator using CreateInstance(Type). Requires a public parameterless constructor. Runtime-specific activators can be injected to handle special types.
Implements
Inherited Members
Namespace: Serenity.Tasking.Application.Utils
Assembly: Serenity.Global.Application.dll
Syntax
public sealed class DefaultInstanceActivator : IInstanceActivator
Constructors
DefaultInstanceActivator()
Declaration
public DefaultInstanceActivator()
Methods
CreateInstance(Type)
Creates an instance of the specified type.
Declaration
public object CreateInstance(Type type)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | type | The type to instantiate. |
Returns
| Type | Description |
|---|---|
| object | A new instance of the type. |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Thrown when the type cannot be instantiated (e.g. no parameterless constructor and no special creation strategy). |
RequiresSpecialContext(Type)
Determines whether instantiating this type requires special runtime conditions (e.g. main-thread affinity in Unity).
Declaration
public bool RequiresSpecialContext(Type type)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | type | The type to check. |
Returns
| Type | Description |
|---|---|
| bool | True if instantiation has special requirements. |
Remarks
The default activator has no special context requirements. Always returns false.