LocationInterceptionAspect.OnSetValue Method |
Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 2023.0.3.0 (2023.0.3.0)
public virtual void OnSetValue( LocationInterceptionArgs args )
Parameters
- args
- Type: PostSharp.Aspects.LocationInterceptionArgs
Advice arguments.
Implements
ILocationInterceptionAspect.OnSetValue(LocationInterceptionArgs)This method is invoked instead of the setter of the property to which the current aspect is applied. If it is applied to a field, that field is transformed into a property. This method intercepts all writes to static properties, but it does not intercept inline initializers of instance properties; use OnInstanceLocationInitialized(LocationInitializationArgs) for that.
If you apply this advice to a getter-only auto-implemented property, PostSharp will create a setter that will be called in these cases:
- for static properties, instead of the property inline initialization or property assignment from the static constructor;
- for instance properties, only instead of the property assignment from the constructor but not for the inline initialization (use the OnInstanceLocationInitialized(LocationInitializationArgs) advice to intercept inline initialization of an instance property).