Custom attribute that, when applied on a method of an aspect class, specifies that this method is an advice that has the same semantics as OnGetValue(LocationInterceptionArgs).
Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp.dll
Syntax
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
public sealed class OnLocationGetValueAdvice : GroupingAdviceRemarks
The method to which this custom attribute is applied must be public and must return void. It can be static.
Each parameter of the method receives a value of the target, selected by a custom attribute derived from
AdviceParameterAttribute, such as BindingAttribute or LocationValueAttribute.
Alternatively, the method can have the same signature as OnGetValue(LocationInterceptionArgs),
whose LocationInterceptionArgs parameter is allocated on each call. The LocationInterceptionArgs parameter can also be the first parameter,
followed by bound parameters.
If an aspect defines many advices (among OnLocationSetValueAdvice, OnLocationGetValueAdvice) and if these advices are meant to be applied to the same properties with consistent ordering, they should be grouped together (see Master property).
A master advice without a custom attribute derived from Pointcut applies to the field or property to which the aspect is applied; when the aspect is applied to another kind of declaration, a pointcut is required. An advice without Master and without pointcut joins the group of the master advice declared in its class.
Constructors
| Name | Description |
|---|---|
| OnLocationGetValueAdvice() |