Post­Sharp Documentation / API Reference / Post­Sharp.​Aspects.​Advices Namespace / Introduce­Interface­Attribute Class

IntroduceInterfaceAttribute Class

Custom attribute that, when applied to an aspect class, specifies that the aspect should introduce a given interface into the type to which the aspect is applied.
Inheritance Hierarchy
System.Object
  System.Attribute
    PostSharp.Aspects.Advices.Advice
      PostSharp.Aspects.Advices.IntroduceInterfaceAttribute

Namespace:  PostSharp.Aspects.Advices
Assembly:  PostSharp (in PostSharp.dll) Version: 5.0.38.0 (5.0.38.0)
Syntax
C#
public sealed class IntroduceInterfaceAttribute : Advice

The IntroduceInterfaceAttribute type exposes the following members.

Constructors
  NameDescription
Public methodIntroduceInterfaceAttribute
Initializes a new IntroduceInterfaceAttribute.
Properties
  NameDescription
Public propertyAncestorOverrideAction
Specifies the action (Fail or Ignore) to be overtaken when an ancestor of the interface specified in the constructor of this custom attribute is already implemented by the type to which the current aspect is applied.
Public propertyDescription
A human-readable description of the current advice.
(Inherited from Advice.)
Public propertyLinesOfCodeAvoided
Reduction in the code lines count achieved by applying the advice instance to one code element.
(Inherited from Advice.)
Public propertyOverrideAction
Specifies the action (Fail or Ignore) to be overtaken when the interface specified in the constructor of this custom attribute is already implemented by the type to which the current aspect is applied.
Extension Methods
  NameDescription
Public Extension MethodQueryInterface<T>
Gets the implementation of a specified interface for the specified object.
(Defined by QueryInterfaceExtensions.)
Remarks

The introduced interface will be implemented explicitly by the type to which the aspect is applied.

See Also