LocationInterceptionAspect.OnSetValue Method
OnSetValue(LocationInterceptionArgs)
Method invoked instead of the Set
semantic of the field or property to which the current aspect is applied,
i.e. when the value of this field or property is changed.
Declaration
[RequiresLocationInterceptionAdviceAnalysis]
[RequiresDebuggerEnhancement]
[HasInheritedAttribute]
[LocationInterceptionAdviceOptimization]
public virtual void OnSetValue(LocationInterceptionArgs args)
Parameters
Type | Name | Description |
---|---|---|
LocationInterceptionArgs | args | Advice arguments. |
Implements
Remarks
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: