PostSharp.ILAPI ReferencePost­Sharp.​Aspects.​AdvicesImport­Member­Attribute
Open sandboxFocus

ImportMemberAttribute Class

Custom attribute that, when applied to an instance field of an aspect class, determines that this field should be bound to a method, event or property, of the target class of this aspect. Valid types for fields are a concrete Delegate (to bind to a method), Property<TValue> or Property<TValue, TIndex> (to bind to a property), or Event<TDelegate> (to bind to an event).

Inheritance
ImportMemberAttribute
Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp.dll
Syntax
public sealed class ImportMemberAttribute : Advice

Constructors

Name Description
ImportMemberAttribute(String)

Initializes a new ImportMemberAttribute and specifies a single name for the member to import.

ImportMemberAttribute(String[])

Initializes a new ImportMemberAttribute and specifies several possible names for the member to import.

Properties

Name Description
IsRequired

Determines whether a build time error must be issued if the member to be imported is absent. If false, the binding field will be null in case the imported member is absent.

MemberNames

Array of possible names of imported member in the order of precedence.

Order

Determines when the member should be imported: either before (BeforeIntroductions) or after (AfterIntroductions) members have been introduced by the current aspect. Default is BeforeIntroductions.