PostSharp6.7//API Reference/Post­Sharp.​Aspects Namespace/Location­Interception­Aspect Class/Location­Interception­Aspect Methods/Location­Interception­Aspect.​On­Instance­Location­Initialized Method

LocationInterceptionAspect.OnInstanceLocationInitialized Method

Method invoked after an initial value is set for a field or property to which the current aspect is applied. The method is invoked only for instance fields and instance auto-implemented properties, and it is invoked after their inline initialization. For static fields and properties, and for accesses from the constructor, OnSetValue is invoked instead.

Namespace:  PostSharp.Aspects
Assembly:  PostSharp (in PostSharp.dll) Version: 6.7.10.0 (6.7.10.0)
Syntax
C#
public virtual void OnInstanceLocationInitialized(
	LocationInitializationArgs args
)

Parameters

args
Type: PostSharp.Aspects.LocationInitializationArgs
Information about the location.

Implements

IOnInstanceLocationInitializedAspect.OnInstanceLocationInitialized(LocationInitializationArgs)
Remarks

This method is invoked at the beginning of an instance constructor. If more than one field or property is affected by this advice, this method will be called for them in declaration order of the properties (so, if in your C# file you declare first "a", then "b", then the method will be called for "a" first). If more than one advice group applies to a property, they will be called in order of aspect priority as normal.

This method is invoked for all instance fields and auto-implemented properties, even if they do not have an initializer. If they don't, the method is called with the default value in the Value property (null, zero, or false).

For structs, this method is only invoked if an actual non-default constructor of the struct is invoked.

See Also