Post­Sharp Documentation / API Reference / Post­Sharp.​Aspects.​Advices Namespace / Initialize­Aspect­Instance­Advice Class

InitializeAspectInstanceAdvice Class

Custom attribute that, when applied to a method of an aspect class, specifies that this method should be invoked whenever the aspect instance needs to be initialized. The target method must have a void return value and have a single parameter of type AspectInitializationReason. This method is equivalent to RuntimeInitializeInstance()
Inheritance Hierarchy
System.Object
  System.Attribute
    PostSharp.Aspects.Advices.Advice
      PostSharp.Aspects.Advices.InitializeAspectInstanceAdvice

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

The InitializeAspectInstanceAdvice type exposes the following members.

Constructors
  NameDescription
Public methodInitializeAspectInstanceAdvice
Initializes a new instance of the InitializeAspectInstanceAdvice 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.)
Remarks
See Also