Show / Hide Table of Contents

Class ActivatorBase

Base abstract class activators.

Inheritance
System.Object
ActivatorBase
EntityActivator
RuntimeActivator
Implements
IActivator
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Kephas.Activation
Assembly: Kephas.Core.dll
Syntax
public abstract class ActivatorBase : IActivator

Methods

| Improve this Doc View Source

ComputeImplementationType(ITypeInfo, IContext, Boolean)

Computes the type implementing the abstract type provided as the parameter.

Declaration
protected virtual ITypeInfo ComputeImplementationType(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.

| Improve this Doc View Source

CreateInstance(ITypeInfo, IEnumerable<Object>, IContext)

Creates an instance of the provided ITypeInfo.

Declaration
public virtual 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.

| Improve this Doc View Source

GetImplementationType(ITypeInfo, IContext, Boolean)

Gets the type implementing the abstract type provided as the parameter.

Declaration
public virtual 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.

| Improve this Doc View Source

GetImplementationTypes()

Gets the supported implementation types.

Declaration
protected virtual IEnumerable<ITypeInfo> GetImplementationTypes()
Returns
Type Description
System.Collections.Generic.IEnumerable<ITypeInfo>

An enumeration of implementation types.

Remarks

The ActivatorBase class provides always an empty list of implementation types. The inheritors should provide a proper list of supported implementation types annotated with ImplementationForAttribute, otherwise only non-abstract types will be resolved.

| Improve this Doc View Source

TryGetTypeInfo(ITypeInfo)

Tries to get the native type information.

Declaration
protected virtual TypeInfo TryGetTypeInfo(ITypeInfo abstractType)
Parameters
Type Name Description
ITypeInfo abstractType

Indicates the abstract type.

Returns
Type Description
System.Reflection.TypeInfo

A TypeInfo.

Implements

IActivator

Extension Methods

DynamicObjectExtensions.SetPropertyValue(Object, String, Object)
DynamicObjectExtensions.TrySetPropertyValue(Object, String, Object)
DynamicObjectExtensions.GetPropertyValue(Object, String)
DynamicObjectExtensions.TryGetPropertyValue(Object, String, out Object)
DynamicObjectExtensions.GetRuntimeTypeInfo(Object)
DynamicObjectExtensions.ToDynamic(Object)
DynamicObjectExtensions.ToExpando(Object)
BehaviorValue.ToBehaviorValue<TValue>(TValue)
CollectionExtensions.AddRange<T, TItem>(T, IEnumerable<TItem>)
LoggingExtensions.GetLogger(Object, IContext)
TypeExtensions.GetAbstractType(Object)
TypeExtensions.GetAbstractTypeInfo(Object)
ReflectionHelper.GetTypeInfo(Object)
EntityEntryExtensions.TryGetAttachedEntityEntry(Object)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX