Open sandboxFocus

Namespace PostSharp.Aspects.Advices

Classes

Advice

Base class for all custom attributes representing an advice.

AdviceInstance

Base class for advice instances, which can be provided dynamically by the aspect thanks to the IAdviceProvider interface.

CopyCustomAttributesAttribute

Custom attribute that, when applied on an aspect class, requires custom attributes present on the aspect class to be copied to the target of this class. When applied on an introduced member (see IntroduceMemberAttribute), this custom attribute requires custom attributes present on the aspect member to be copied to the introduced member.

Event<TDelegate>

Exposes the semantics of an event for use with the ImportMemberAttribute aspect extension.

GroupingAdvice

Base class for all advices that are possibly composed of multiple advices that can be grouped together using the Master property.

ImportLocationAdviceInstance

Represents an advice that imports a field or property (represented by a LocationInfo) of the target class into a field of the aspect class. This class is the imperative equivalent of the ImportMemberAttribute declarative advise.

ImportMemberAdviceInstance

Base class for ImportLocationAdviceInstance and ImportMethodAdviceInstance.

ImportMemberAttribute

Custom attribute that, when applied to an instance field of an aspect class, determines that this field should be bound to a method, event or property, of the target class of this aspect. Valid types for fields are a concrete Delegate (to bind to a method), Property<TValue> or Property<TValue, TIndex> (to bind to a property), or Event<TDelegate> (to bind to an event).

ImportMethodAdviceInstance

Represents an advises that import a method of the target class into the aspect class.

InitializeAspectInstanceAdvice

Custom attribute that, when applied to a method of an aspect class, specifies that this method should be invoked whenever the aspect instance needs to be initialized. The target method must have a void return value and have a single parameter of type AspectInitializationReason. This method is equivalent to RuntimeInitializeInstance()

IntroduceInterfaceAdviceInstance

Represents an advise that introduces an interface into the target class. The interface must be implemented by the aspect class.

IntroduceInterfaceAttribute

Custom attribute that, when applied to an aspect class, specifies that the aspect should introduce a given interface into the type to which the aspect is applied.

IntroduceMemberAdviceInstance

Base class for IntroduceMethodAdviceInstance.

IntroduceMemberAttribute

Custom attribute that, when applied on a method, event or property of an aspect class, specifies that this method, event or property should be introduced into the types to which the aspect is applied.

IntroduceMethodAdviceInstance

Represents an advice that introduces a method of the aspect class into the target class.

LocationValidationAdvice

Custom attribute that, when applied on a method of an aspect class, specifies that this method has the same semantic as the ValidateValue(T, string, LocationKind, LocationValidationContext) method of the ILocationValidationAspect<T> interface.

MethodPointcut

Custom attribute that, when applied on an advice method, specifies the name of the method that will be invoked at build-time to return the set of elements of code to which the advice applies.

MulticastPointcut

Custom attribute that, when applied on an advice method, specifies to which elements of code this advice applies, based on the kind, name and attributes of code elements. Works similarly as MulticastAttribute.

OnAspectsInitializedAdvice

Custom attribute that, when applied to a method of an aspect class, specifies that this method should be invoked after the instances of all the aspects applied on the same target has been initialized. The target method must have a void return value and have a single parameter of type AspectInitializationReason.

OnEventAddHandlerAdvice

Custom attribute that, when applied on a method of an aspect class, specifies that this method is an advice having the same semantics as OnAddHandler(EventInterceptionArgs).

OnEventInvokeHandlerAdvice

Custom attribute that, when applied on a method of an aspect class, specifies that this method is an advice having the same semantics as OnInvokeHandler(EventInterceptionArgs).

OnEventRemoveHandlerAdvice

Custom attribute that, when applied on a method of an aspect class, specifies that this method is an advice having the same semantics as OnRemoveHandler(EventInterceptionArgs).

OnInstanceConstructedAdvice

Custom attribute that, when applied to a method of an aspect, specifies that this method should be executed after the last instance constructor of the target class of the aspect has completed execution. That is, this method will be invoked when the target object will be fully constructed. This custom attribute can be applied only on methods that have return type void and no parameters.

OnInstanceLocationInitializedAdvice

Custom attribute that, when applied on a method of an aspect class, specifies that this method is an advice having the same semantics as OnInstanceLocationInitialized(LocationInitializationArgs).

OnLocationGetValueAdvice

Custom attribute that, when applied on a method of an aspect class, specifies that this method is an advice having the same semantics as OnGetValue(LocationInterceptionArgs).

OnLocationSetValueAdvice

Custom attribute that, when applied on a method of an aspect class, specifies that this method is an advice having the same semantics as OnSetValue(LocationInterceptionArgs).

OnMethodBoundaryAdvice

Base class for OnMethodEntryAdvice, OnMethodExceptionAdvice, OnMethodSuccessAdvice or OnMethodExitAdvice.

OnMethodEntryAdvice

Custom attribute that, when applied on a method of an aspect class, specifies that this method is an advice having the same semantics as OnEntry(MethodExecutionArgs).

OnMethodExceptionAdvice

Custom attribute that, when applied on a method of an aspect class, specifies that this method is an advice having the same semantics as OnException(MethodExecutionArgs).

OnMethodExitAdvice

Custom attribute that, when applied on a method of an aspect class, specifies that this method is an advice having the same semantics as OnExit(MethodExecutionArgs).

OnMethodInvokeAdvice

Custom attribute that, when applied on a method of an aspect class, specifies that this method is an advice having the same semantics as OnInvoke(MethodInterceptionArgs).

OnMethodInvokeAsyncAdvice

Custom attribute that, when applied on a method of an aspect class, specifies that this method is an advice having the same semantics as OnInvokeAsync(MethodInterceptionArgs).

OnMethodInvokeBaseAdvice

The base class for method interception advices.

OnMethodResumeAdvice

Custom attribute that, when applied on a method of an aspect class, specifies that this method is an advice having the same semantics as OnResume(MethodExecutionArgs).

OnMethodSuccessAdvice

Custom attribute that, when applied on a method of an aspect class, specifies that this method is an advice having the same semantics as OnSuccess(MethodExecutionArgs).

OnMethodYieldAdvice

Custom attribute that, when applied on a method of an aspect class, specifies that this method is an advice having the same semantics as OnYield(MethodExecutionArgs).

Pointcut

Custom attribute, typically accompanying an advice, specifying to which code elements the advice applies.

Property<TValue>

Exposes the semantics of a parameterless property for use with the ImportMemberAttribute aspect extension.

Property<TValue, TIndex>

Mimics the semantics of a property accepting a single index parameter, for use with the ImportMemberAttribute aspect extension.

SelfPointcut

Pointcut that selects exactly the aspect target.

SignaturePointcut

A Pointcut that matches target methods by name and signature. This works only with non-generic methods.

Interfaces

IAdviceProvider

Interface that allows an aspect to provide aspects dynamically, instead of declaratively using custom attributes.

IProperty

A weakly-typed interface for the Property<TValue> class.

Enums

AspectInitializationReason

Enumerates the reasons why the target method of the InitializeAspectInstanceAdvice has been invoked.

CustomAttributeOverrideAction

Behavior of CopyCustomAttributesAttribute when a custom attribute of the same type already exists on the target declaration.

ImportMemberOrder

Enumeration of moments when members should be imported into an aspect.

InterfaceOverrideAction

Enumeration of actions to be overtaken when an interface that should be introduced into a type is already implemented by that type.

MemberOverrideAction

Enumeration of actions to be overtaken by the IntroduceMemberAttribute aspect extension when the member to be introduced already exists in the aspect target type or its base type.

Delegates

EventAccessor<TDelegate>

Defines the signature of methods implementing the Add and Remove semantics of an event.

PropertyGetter<TValue>

Defines the signature of methods implementing the Get semantic of a parameterless property.

PropertyGetter<TValue, TIndex>

Defines the signature of methods implementing the Get semantic of a property with a single index parameter.

PropertySetter<TValue>

Defines the signature of methods implementing the Set semantic of a parameterless property.

PropertySetter<TValue, TIndex>

Defines the signature of methods implementing the Set semantic of a property with a single index parameter.