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

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

Initializes a new instance of the ImportMethodAdviceInstance.

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

Parameters

aspectField
Type: System.Reflection.FieldInfo
A field of the aspect class into that will be assigned to a delegate of the imported method at runtime. The field type should be a delegate of the same signature than the method to import.
methodNames
Type: System.String[]
Fallback list of possible names of the member to be imported.
isRequired (Optional)
Type: System.Boolean
true if the build should fail if there no matching method in the target class, false to set aspectField to null in this case.
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