PostSharp 4.3 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Aspects.​Advices Namespace
PostSharp.Aspects.Advices Namespace
The PostSharp.Aspects.Advices provides custom attributes that allow developing composite aspects with advices and pointcuts.
Classes
  Class Description
Public class Advice
Base class for all custom attributes representing an advice.
Public class AdviceInstance
Base class for advice instances, which can be provided dynamically by the aspect thanks to the IAdviceProvider interface.
Public class 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.
Public class Event<TDelegate>
Exposes the semantics of an event for use with the ImportMemberAttribute aspect extension.
Public class GroupingAdvice
Base class for all advices that are possibly composed of multiple advices that can be grouped together using the Master property.
Public class 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.
Public class ImportMemberAdviceInstance
Public class 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).
Public class ImportMethodAdviceInstance
Represents an advises that import a method of the target class into the aspect class.
Public 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()
Public class IntroduceInterfaceAdviceInstance
Represents an advise that introduces an interface into the target class. The interface must be implemented by the aspect class.
Public 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.
Public class IntroduceMemberAdviceInstance
Public class 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.
Public class IntroduceMethodAdviceInstance
Represents an advice that introduces a method of the aspect class into the target class.
Public 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) method of the ILocationValidationAspect<T> interface.
Public class 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.
Public class 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.
Public class 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.
Public class 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).
Public class 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).
Public class 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).
Public class OnInstanceConstructedAdvice
Custom attribute that, when applied to a method of an aspect implementing , 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 void return type and accepts no parameter.
Public class 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).
Public class 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).
Public class OnMethodBoundaryAdvice
Public class 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).
Public class 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).
Public class 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).
Public class 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).
Public class 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).
Public class 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).
Public class 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).
Public class Pointcut
Custom attribute, typically accompanying an advice, specifying to which code elements the advice applies.
Public class Property<TValue>
Exposes the semantics of a parameterless property for use with the ImportMemberAttribute aspect extension.
Public class Property<TValue, TIndex>
Mimics the semantics of a property accepting a single index parameter, for use with the ImportMemberAttribute aspect extension.
Public class SelfPointcut
Pointcut that selects exactly the aspect target.
Interfaces
  Interface Description
Public interface IAdviceProvider
Interface that allows an aspect to provide aspects dynamically, instead of declaratively using custom attributes.
Public interface IProperty
A weakly-typed interface for the class.
Delegates
  Delegate Description
Public delegate EventAccessor<TDelegate>
Defines the signature of methods implementing the Add and Remove semantics of an event.
Public delegate PropertyGetter<TValue>
Defines the signature of methods implementing the Get semantic of a parameterless property.
Public delegate PropertyGetter<TValue, TIndex>
Defines the signature of methods implementing the Get semantic of a property with a single index parameter.
Public delegate PropertySetter<TValue>
Defines the signature of methods implementing the Set semantic of a parameterless property.
Public delegate PropertySetter<TValue, TIndex>
Defines the signature of methods implementing the Set semantic of a property with a single index parameter.
Enumerations
  Enumeration Description
Public enumeration AspectInitializationReason
Enumerates the reasons why the target method of the InitializeAspectInstanceAdvice has been invoked.
Public enumeration CustomAttributeOverrideAction
Behavior of CopyCustomAttributesAttribute when a custom attribute of the same type already exists on the target declaration.
Public enumeration ImportMemberOrder
Enumeration of moments when members should be imported into an aspect.
Public enumeration InterfaceOverrideAction
Enumeration of actions to be overtaken when an interface that should be introduced into a type is already implemented by that type.
Public enumeration 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.