Open sandboxFocus

Class OnAspectsInitializedAdvice

Custom attribute that, when applied to a method of an aspect class, specifies that this method should be invoked after the instances of all the aspects applied on the same target have been initialized. The target method must have a void return value and have a single parameter of type AspectInitializationReason.

Inheritance
OnAspectsInitializedAdvice
Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp.dll
Syntax
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
public sealed class OnAspectsInitializedAdvice : Advice
Remarks

Use this advice instead of InitializeAspectInstanceAdvice when the initialization logic of the aspect depends on other aspects of the same target being initialized.

The aspect must be applied to a type or to a member of a type. For a member, the advice is registered on the declaring type of the member. In an aspect applied to an assembly, such as an AssemblyLevelAspect, the advice causes the error LA0088.

Constructors

Name Description
OnAspectsInitializedAdvice()

See Also