PostSharp4.3//API Reference/Post­Sharp.​Aspects.​Advices Namespace/On­Method­Invoke­Advice Class
OnMethodInvokeAdvice Class
Custom attribute that, when applied on a method of an aspect class, specifies that this method is an advice having the same semantics as OnInvoke(MethodInterceptionArgs).
Inheritance Hierarchy
System.Object
  System.Attribute
    PostSharp.Aspects.Advices.Advice
      PostSharp.Aspects.Advices.OnMethodInvokeAdvice

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

The OnMethodInvokeAdvice type exposes the following members.

Constructors
  NameDescription
Public methodOnMethodInvokeAdvice
Initializes a new instance of the OnMethodInvokeAdvice class
Properties
  NameDescription
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.)
Extension Methods
  NameDescription
Public Extension MethodQueryInterface<T>
Gets the implementation of a specified interface for the specified object.
(Defined by QueryInterfaceExtensions.)
Remarks

The method to which this custom attribute is applied must be public and must have the same signature as OnInvoke(MethodInterceptionArgs). However, it can be static.

See Also