Open sandboxFocus

Constructor AspectInstance

AspectInstance(object, IAspect)

Initializes a new AspectInstance from a runtime aspect instance (IAspect).

Declaration
public AspectInstance(object targetElement, IAspect aspect)
Parameters
Type Name Description
object targetElement

Code element (Assembly, Type, FieldInfo, MethodBase, PropertyInfo, EventInfo, ParameterInfo, or LocationInfo) to which the current AspectInstance is applied.

IAspect aspect

The aspect runtime instance.

AspectInstance(object, IAspect, AspectConfiguration)

Initializes a new AspectInstance from a runtime aspect instance (IAspect) and its AspectConfiguration.

Declaration
public AspectInstance(object targetElement, IAspect aspect, AspectConfiguration aspectConfiguration)
Parameters
Type Name Description
object targetElement

Code element (Assembly, Type, FieldInfo, MethodBase, PropertyInfo, EventInfo, ParameterInfo, or LocationInfo) to which the current AspectInstance is applied.

IAspect aspect

The aspect runtime instance.

AspectConfiguration aspectConfiguration

The aspect configuration (the type of this parameter should be equal to the type configuration objects expected by the concrete aspect).

AspectInstance(object, ObjectConstruction)

Initializes a new AspectInstance from an ObjectConstruction.

Declaration
public AspectInstance(object targetElement, ObjectConstruction aspectConstruction)
Parameters
Type Name Description
object targetElement

Code element (Assembly, Type, FieldInfo, MethodBase, PropertyInfo, EventInfo, ParameterInfo, or LocationInfo) to which the current AspectInstance is applied.

ObjectConstruction aspectConstruction

An ObjectConstruction instructing how the aspect instance should be constructed.

AspectInstance(object, ObjectConstruction, AspectConfiguration)

Initializes a new AspectInstance from an ObjectConstruction and specifies an AspectConfiguration object.

Declaration
public AspectInstance(object targetElement, ObjectConstruction aspectConstruction, AspectConfiguration aspectConfiguration)
Parameters
Type Name Description
object targetElement

Code element (Assembly, Type, FieldInfo, MethodBase, PropertyInfo, EventInfo, ParameterInfo, or LocationInfo) to which the current AspectInstance is applied.

ObjectConstruction aspectConstruction

An ObjectConstruction instructing how the aspect instance should be constructed.

AspectConfiguration aspectConfiguration

An optional configuration object whose type corresponds to the aspect type.