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: 2023.0.3.0 (2023.0.3.0)
C#
public ImportLocationAdviceInstance( FieldInfo aspectField, string propertyName, 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>. - propertyName
- Type: System.String
The name 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.