Open sandboxFocus

Class MethodLevelAspect

Equivalent to IAspect<T> where T is IMethod.

Namespace: PostSharp.Aspects
Assembly: Metalama.Migration.dll
Syntax
[MulticastAttributeUsage(MulticastTargets.Method|MulticastTargets.InstanceConstructor|MulticastTargets.StaticConstructor)]
[AttributeUsage(AttributeTargets.Assembly|AttributeTargets.Class|AttributeTargets.Struct|AttributeTargets.Constructor|AttributeTargets.Method|AttributeTargets.Property|AttributeTargets.Event, AllowMultiple = true)]
[Obsolete("Equivalent to 'IAspect<T>' where <c>T</c> is 'IMethod'.", false)]
public abstract class MethodLevelAspect : Aspect, IMethodLevelAspect, IAspect, IMethodLevelAspectBuildSemantics, IAspectBuildSemantics, IValidableAnnotation

Constructors

Name Description
MethodLevelAspect()

Methods

Name Description
CompileTimeInitialize(MethodBase, AspectInfo)

In Metalama, aspect initialization is done in BuildAspect(IAspectBuilder<T>).

CompileTimeValidate(object)

In Metalama, validation is done in BuildEligibility(IEligibilityBuilder<T>) and BuildAspect(IAspectBuilder<T>). The equivalent of returning false is to call SkipAspect().

CompileTimeValidate(MethodBase)

In Metalama, validation is done in BuildEligibility(IEligibilityBuilder<T>) and BuildAspect(IAspectBuilder<T>). The equivalent of returning false is to call SkipAspect().

RuntimeInitialize(MethodBase)

In Metalama, add an initializer from the BuildAspect(IAspectBuilder<IMethod>) method by calling builder.Advice.AddInitializer(INamedType, string, InitializerKind, object?, object?).

SetAspectConfiguration(AspectConfiguration, object)

Not supported in Metalama.

SetAspectConfiguration(AspectConfiguration, MethodBase)

Not supported in Metalama.