PostSharpAPI ReferencePost­Sharp.​AspectsAspect­Instance
Open sandboxFocus

AspectInstance Class

Completely specifies an aspect instance, including its target code element. An AspectInstance contains either the aspect instance itself (Aspect property), either information allowing to construct the aspect (AspectConstruction) and configure the weaver (AspectConfiguration).

Inheritance
AspectInstance
Namespace: PostSharp.Aspects
Assembly: PostSharp.dll
Syntax
public sealed class AspectInstance : AspectSpecification

Constructors

Name Description
AspectInstance(Object, IAspect)

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

AspectInstance(Object, IAspect, AspectConfiguration)

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

AspectInstance(Object, ObjectConstruction)

Initializes a new AspectInstance from an ObjectConstruction.

AspectInstance(Object, ObjectConstruction, AspectConfiguration)

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

Properties

Name Description
RepresentAsStandalone

Determines whether the AspectInstance should be represented as a stand-alone instance in PostSharp Tools for Visual Studio. If false, the current AspectInstance will be not be represented as a standalone node, and its advices will be merged with the ones provided by the parent aspect (implementing IAspectProvider). The default value is false.

TargetElement

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

See Also