Custom attribute that, when applied on an advice method, specifies the name of the method that is invoked at build time to return the set of elements of code to which the advice applies.
Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp.dll
Syntax
public sealed class MethodPointcut : PointcutRemarks
This method should have the signature
IEnumerable<AdviceTargetType> SelectCodeElements(AspectTargetType target),
where AspectTargetType is either object or a reflection type
corresponding to the kind of targets of the aspect (for instance System.Type
for a type-level aspect), and AdviceTargetType is either object or
a reflection type of the kind of targets of the advice (for instance System.Reflection.MethodInfo for a method-level advice).
The method can select only elements of code that belong to the target of the aspect, for instance members of the target type for a type-level aspect; selecting a member of another type causes a build error. When the selection can be expressed by the kind, name and attributes of the elements, use MulticastPointcut instead.
Constructors
| Name | Description |
|---|---|
| MethodPointcut(string) | Initializes a new instance of the MethodPointcut class. |
Properties
| Name | Description |
|---|---|
| MethodName | Gets the name of the method returning the set of code elements. |