PostSharp6.5//API Reference/Post­Sharp.​Aspects.​Advices Namespace/Import­Location­Advice­Instance Class/Import­Location­Advice­Instance Constructor/Import­Location­Advice­Instance Constructor (Field­Info, String[], Boolean, Import­Member­Order)

ImportLocationAdviceInstance Constructor (FieldInfo, String[], Boolean, ImportMemberOrder)

Initializes a new instance of the ImportLocationAdviceInstance class and specifies the name of the property to be imported; the type of this property will be matched according to the type of the aspect field.

Namespace:  PostSharp.Aspects.Advices
Assembly:  PostSharp (in PostSharp.dll) Version: 6.5.4.0 (6.5.4.0)
Syntax
C#
public ImportLocationAdviceInstance(
	FieldInfo aspectField,
	string[] propertyNames,
	bool isRequired = false,
	ImportMemberOrder order = ImportMemberOrder.Default
)

Parameters

aspectField
Type: System.Reflection.FieldInfo
A field of the aspect class to which the field or property should be bound at build time. This field must be of type Property<TValue>.
propertyNames
Type: System.String[]
Fallback list of possible names of the property to import.
isRequired (Optional)
Type: System.Boolean
Determines whether a build-time error should be emitted if the member cannot be found. If false, the binding field will be null in case the imported member is absent.
order (Optional)
Type: PostSharp.Aspects.Advices.ImportMemberOrder
Determines whether the aspectField should be bound to the member as resolved before or after introduction of new members into the target class by the current advise.
See Also