Interface IActivator
Contract for a service used for object instantiation based on ITypeInfo.
Namespace: Kephas.Activation
Assembly: Kephas.Core.dll
Syntax
public interface IActivator
Methods
| Improve this Doc View SourceCreateInstance(ITypeInfo, IEnumerable<Object>, IContext)
Creates an instance of the provided ITypeInfo.
Declaration
object CreateInstance(ITypeInfo typeInfo, IEnumerable<object> args = null, IContext activationContext = null)
Parameters
Type | Name | Description |
---|---|---|
ITypeInfo | typeInfo | Indicates the ITypeInfo used for the instantiation. |
System.Collections.Generic.IEnumerable<System.Object> | args | Constructor arguments. |
IContext | activationContext | Context for the activation. |
Returns
Type | Description |
---|---|
System.Object | An instance of the provided ITypeInfo. |
Remarks
The typeInfo
may be either an implementation type or an abstract type.
If an abstract type is provided, then an implementation type is determined first and then instantiated.
GetImplementationType(ITypeInfo, IContext, Boolean)
Gets the type implementing the abstract type provided as the parameter.
Declaration
ITypeInfo GetImplementationType(ITypeInfo abstractType, IContext activationContext = null, bool throwOnNotFound = true)
Parameters
Type | Name | Description |
---|---|---|
ITypeInfo | abstractType | Indicates the abstract type. |
IContext | activationContext | Context for the activation. |
System.Boolean | throwOnNotFound | Indicates whether to throw an exception if an implementation type is not found. |
Returns
Type | Description |
---|---|
ITypeInfo | The implementation type for the provided ITypeInfo. |