Open sandboxFocus

Namespace Metalama.Framework.Advising

Classes

AdviceResultExtensions

Extension methods for the IIntroductionAdviceResult<T> interface.

InterfaceImplementationAdviserExtensions

Provides extension methods for introducing explicit interface member implementations via IInterfaceImplementationAdviser.

PullStrategy

Provides factory methods for creating standard implementations of the IPullStrategy interface.

TemplateAttributeProperties

Represents a set of properties that configure how a T# template member should be introduced into target code. These properties allow overriding the name, accessibility, and modifiers of members introduced from templates. When a property is null, its value is inherited from the template member itself.

Structs

GetterTemplateSelector

Specifies which T# templates to use when overriding property or field getters, enabling automatic selection of specialized templates for iterator getters.

MethodTemplateSelector

Specifies which T# templates to use when overriding methods, enabling automatic selection of specialized templates based on the target method's characteristics (async, iterator, async iterator).

PullAction

Represents a way to pull a constructor parameter value from child constructors when propagating introduced parameters.

Interfaces

IAddContractAdviceResult<T>

Represents the result of an advice that adds a contract.

IAddInitializerAdviceResult

Represents the result of an advice that adds an initializer, returned by AddInitializer(IAdviser<IConstructor>, IStatement).

IAdviceAttribute

A marker interface for attributes that provide advice-related metadata. This interface serves as a common base for attributes that configure or describe members used in aspect-oriented programming scenarios, such as templates and declarative advice.

IAdviceFactory

Exposes all factory methods to create advice. Exposed on the Advice property of IAspectBuilder<TAspectTarget> or IAspectBuilder.

IAdviceResult

Represents the result of applying an advice (code transformation) through AdviserExtensions methods. Check the Outcome property to determine whether the advice was successfully applied.

IImplementInterfaceAdviceResult

Represents the result of ImplementInterface(IAdviser<INamedType>, INamedType, OverrideStrategy, object?) advice.

IInterfaceImplementationAdviser

Provides methods to introduce explicit interface member implementations.

IInterfaceImplementationResult

Describes an interface type implemented by advice, including the implementation outcome.

IInterfaceMemberImplementationResult

Describes how an individual interface member was implemented by advice.

IIntroductionAdviceResult<T>

Represents the result of introduction advice methods such as IntroduceMethod(IAdviser<INamedType>, string, IntroductionScope, OverrideStrategy, Action<IMethodBuilder>?, object?, object?), IntroduceProperty, IntroduceField, or IntroduceEvent.

IOverrideAdviceResult<T>

Represents the result of override advice, returned by methods such as OverrideAccessors(IAdviser<IFieldOrProperty>, in GetterTemplateSelector, string?, object?, object?).

IPullStrategy

A strategy that defines how an introduced constructor parameter should be propagated (or "pulled") to child constructors in derived classes. For standard implementations, see PullStrategy.

IRemoveAttributesAdviceResult

Represents the result of an advice that removes attributes, returned by RemoveAttributes(IAdviser<IDeclaration>, INamedType).

ITemplateAttribute

Defines an interface for attributes that mark and configure T# template members. Template attributes allow you to override properties such as the name, accessibility, and modifiers (virtual, sealed, abstract, etc.) of members introduced from templates. When a property is not explicitly set, its value is inherited from the template member itself.

Enums

AdviceKind

Enumerates the different types of code transformations (advice) that can be applied by aspects. Each advice kind corresponds to a specific transformation operation available through AdviserExtensions.

AdviceOutcome

Indicates the result of applying an advice (code transformation). This enum is returned via Outcome by all advice methods to indicate whether the transformation succeeded, was ignored, or encountered an error.

InitializerKind

Specifies the kind of initializer that should be added by an advice operation.

InterfaceImplementationOutcome

Indicates the action taken by the advice when implementing an interface.

InterfaceMemberImplementationOutcome

Indicates the action taken by the advice when implementing an individual interface member.