PostSharp 4.3 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Aspects Namespace
PostSharp.Aspects Namespace
The PostSharp.Aspects namespace provides the primitives of the PostSharp aspect-oriented framework, such as abstract aspect classes, aspect interfaces, and advise argument classes.
Classes
  Class Description
Public class AdviceArgs
Base class for arguments of all advices.
Public class Arguments
Encapsulation of method arguments.
Public class Aspect
Base class for all aspects that are declared using multicast custom attributes (MulticastAttribute).
Public class AspectDescriptionAttribute
Custom attribute that, when applied to an aspect class, specifies a human-readable description of the aspect that can be displayed in PostSharp Tools for Visual Studio.
Public class AspectInfo
Reserved for future usage.
Public class AspectInstance
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).
Public class AspectSpecification
Completely specifies an aspect instance (but not its target). An AspectSpecification either the aspect instance itself (Aspect property), either information allowing to construct the aspect (AspectConstruction) and configure the weaver (AspectConfiguration).
Public class AspectUtilities
Utility methods for PostSharp.Aspects.
Public class AssemblyLevelAspect
Base class for all aspects applied on assemblies.
Public class CompositionAspect
Aspect that, when applied on a type, introduces one or many new interfaces into that type.
Public class CustomAttributeIntroductionAspect
Aspect that, when applied to a target, adds a custom attribute to this target.
Public class EventInterceptionArgs
Arguments of handlers of aspects of the type EventInterceptionAspect.
Public class EventInterceptionAspect
Aspect that, when applied on an event, intercepts invocations of its semantics Add (OnAddHandler(EventInterceptionArgs)), Remove (OnRemoveHandler(EventInterceptionArgs)) and Invoke (OnInvokeHandler(EventInterceptionArgs)).
Public class EventLevelAspect
Base class for all aspects applied on events.
Public class FieldLevelAspect
Base class for all aspects applied on fields.
Public class InstanceLevelAspect
Base class for aspects applied on types, but having the same lifetime as instances of the type to which they are applied.
Public class LinesOfCodeAvoidedAttribute
Custom attribute that, when applied to an aspect class, specifies how many manual lines of code are avoided every time the aspect is being used.
Public class LocationBindingExtensions
Extension methods for the ILocationBinding interface.
Public class LocationInterceptionArgs
Arguments of advices of aspect type LocationInterceptionAspect.
Public class LocationInterceptionAspect
Aspect that, when applied on a location (field or property), intercepts invocations of the Get (OnGetValue(LocationInterceptionArgs)) and Set (OnSetValue(LocationInterceptionArgs)) semantics.
Public class LocationLevelAspect
Base class for aspects defined in fields, properties, or parameters.
Public class ManagedResourceIntroductionAspect
Aspect that, when applied to an assembly, adds a custom attribute to this assembly.
Public class MethodExecutionArgs
Arguments of advices of aspects of type OnMethodBoundaryAspect and OnExceptionAspect
Public class MethodImplementationAspect
Aspect that, when applied on an abstract or extern method, creates an implementation for this method.
Public class MethodInterceptionArgs
Arguments of advices of aspect type MethodInterceptionAspect.
Public class MethodInterceptionAspect
Aspect that, when applied on a method, intercepts invocations of this method.
Public class MethodLevelAspect
Base class for all aspects applied on methods.
Public class ModuleInitializerAttribute
Custom attribute that, when added to a static method, causes the method to be executed immediately after the assembly is loaded by the CLR. The target method must be public, parameterless, void, and non-generic.
Public class OnExceptionAspect
Aspect that, when applied to a method, defines an exception handler around the whole method and calls a custom method in this exception handler.
Public class OnMethodBoundaryAspect
Aspect that, when applied to a method defined in the current assembly, inserts a piece of code before and after the body of these methods.
Public class TypeIdentity
Wraps a Type or a type name.
Public class TypeLevelAspect
Base class for all aspects applied on types.
Structures
  Structure Description
Public structure ConstructorDepth
System type used in the implementation of the OnInstanceConstructedAdvice. Do not use in user code.
Public structure InstanceCredentials Obsolete.
Credentials that give access to 'protected' semantics.
Interfaces
  Interface Description
Public interface IAspect
Base interface for run-time semantics of all aspects.
Public interface IAspectBuildSemantics
Compile-time semantics of IAspect.
Public interface IAspectInstance
Represents an instance of an aspect applied to a declaration.
Public interface IAspectProvider
Interface that, when implemented by an aspect class, allows aspect instances to provide other aspects to the weaver.
Public interface IAspectRepositoryService
Service that allows to determine which aspects have been applied to a given declaration, whether declaratively through custom attributes or MulticastAttribute, or programmatically using IAspectProvider.
Public interface IAssemblyLevelAspect
Runtime semantics of aspects applied at assembly level.
Public interface IAssemblyLevelAspectBuildSemantics
Build-time semantics of aspects applied at assembly level.
Public interface ICloneAwareAspect
Defines the semantics of aspects that require to be notified after a target object is cloned using MemberwiseClone().
Public interface IComposed<T> Obsolete.
Interface exposing the implementation of another interface introduced by a CompositionAspect.
Public interface ICompositionAspect
Defines the semantics of an aspect that, when applied on a type, introduce one or many new interfaces into that type, and let these interfaces be implemented by an object created at runtime.
Public interface ICustomAttributeIntroductionAspect
Semantics of an aspect that, when applied to a target, adds a custom attribute to this target.
Public interface IEventBinding
Interface through which an event-level aspect or advice can invoke the next node in the chain of invocation.
Public interface IEventInterceptionAspect
Runtime semantics of an aspect that, when applied on an event, intercepts invocations of its semantics Add (OnAddHandler(EventInterceptionArgs)), Remove (OnRemoveHandler(EventInterceptionArgs)) and Invoke (OnInvokeHandler(EventInterceptionArgs)) semantics.
Public interface IEventLevelAspect
Runtime semantics of aspects that can be applied on events.
Public interface IEventLevelAspectBuildSemantics
Build-time semantics of aspects that can be applied on events.
Public interface IFieldLevelAspect
Run-time semantics of aspects applied to fields.
Public interface IFieldLevelAspectBuildSemantics
Compile-time semantics of IFieldLevelAspect.
Public interface IInstanceScopedAspect
Runtime semantics of aspects that have the same lifetime as instance of types to which their are applied (or instance of the declaring type of members to which they are applied).
Public interface ILocationBinding
Interface through which a field- or property-level aspect or advice can invoke the next node in the chain of invocation.
Public interface ILocationBinding<T>
A strongly-typed variant for ILocationBinding.
Public interface ILocationBindingAction<TPayload>
Exposes an Execute<TValue>(ILocationBinding<TValue>, TPayload) method invoked by the Execute<TPayload>(ILocationBindingAction<TPayload>, TPayload) method, which allows to execute strongly-typed operations and avoid boxing required by the weakly typed ILocationBinding interface.
Public interface ILocationInterceptionArgs
An interface for LocationInterceptionArgs.
Public interface ILocationInterceptionArgs<T>
A strongly-typed specialization of the ILocationInterceptionArgs interface.
Public interface ILocationInterceptionArgsAction<TPayload>
Exposes an Execute<TValue>(ILocationInterceptionArgs<TValue>, TPayload) method invoked by the Execute<TPayload>(ILocationInterceptionArgsAction<TPayload>, TPayload) method, which allows to execute strongly-typed operations and avoid boxing required by the weakly typed ILocationInterceptionArgs interface.
Public interface ILocationInterceptionAspect
Runtime semantics of an aspect that, when applied on a location (field or property), intercepts invocations of the Get (OnGetValue(LocationInterceptionArgs)) and Set (OnSetValue(LocationInterceptionArgs)) semantics.
Public interface ILocationLevelAspect
Runtime semantics of aspects defined on a field, property, or parameter.
Public interface ILocationLevelAspectBuildSemantics
Compile-time semantics of ILocationLevelAspect.
Public interface ILocationValidationAspect
Public interface ILocationValidationAspect<T>
Runtime semantics of an aspect that, when applied on a location (field, property, or parameter), validates the value assigned to this location using method ValidateValue(T, String, LocationKind), and throws the exception returned by this method if any.
Public interface IManagedResourceIntroductionAspect
Semantics of an aspect that, when applied to an assembly, adds a managed resource to this assembly.
Public interface IMethodBinding
Interface through which a method-level aspect or advice can invoke the next node in the chain of invocation.
Public interface IMethodInterceptionAspect
Runtime semantics of an aspect that, when applied on a method, intercepts invocations of this method.
Public interface IMethodLevelAspect
Runtime semantics of aspects applied to methods.
Public interface IMethodLevelAspectBuildSemantics
Compile-time semantics of IMethodLevelAspect.
Public interface IOnExceptionAspect
Runtime semantics of an aspect that, when applied on a method, defines an exception handler around the whole method body and let the implementation of this interface handle the exception.
Public interface IOnMethodBoundaryAspect
Runtime semantics of OnMethodBoundaryAspect.
Public interface IOnStateMachineBoundaryAspect
Extends the IOnMethodBoundaryAspect interface with two advises to be applied on state machines.
Public interface IProtectedInterface<T> Obsolete.
Gives access to a 'protected' interface, typically introduced by a CompositionAspect or a IntroduceInterfaceAttribute
Public interface ITypeLevelAspect
Run-time semantics of aspects applied to types.
Public interface ITypeLevelAspectBuildSemantics
Compile-time semantics of ITypeLevelAspect.
Enumerations
  Enumeration Description
Public enumeration FlowBehavior
Enumerates the possible behaviors of the calling method after the calling method has returned.
Public enumeration LocationValidationContext
Enumerates the possible contexts in which the location validation advices can be invoked.