Open sandboxFocus

Class InterfaceImplementationAdviserExtensions

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

Inheritance
InterfaceImplementationAdviserExtensions
Namespace: Metalama.Framework.Advising
Assembly: Metalama.Framework.dll
Syntax
[CompileTime]
public static class InterfaceImplementationAdviserExtensions
Remarks

Use these methods to programmatically add explicit interface member implementations after calling ImplementInterface(IAdviser<INamedType>, INamedType, OverrideStrategy, object?). Access the IInterfaceImplementationAdviser through the ExplicitMembers or ExplicitMembers property.

Methods

Name Description
IntroduceEvent(IInterfaceImplementationAdviser, string, IntroductionScope, OverrideStrategy, Action<IEventBuilder>?, object?)

Introduces a new event to the target type, or overrides the implementation of an existing one, by specifying an event template. Use the With<TNewDeclaration>(TNewDeclaration) method to apply the advice to another declaration than the current one.

IntroduceEvent(IInterfaceImplementationAdviser, string, string, string, string?, string?, IntroductionScope, OverrideStrategy, Action<IEventBuilder>?, object?, object?)

Introduces a new event to the target type, or overrides the implementation of an existing one, by specifying individual template methods for the adder, the remover, and the raiser. Use the With<TNewDeclaration>(TNewDeclaration) method to apply the advice to another declaration than the current one.

IntroduceIndexer(IInterfaceImplementationAdviser, IType, string?, string?, IntroductionScope, OverrideStrategy, Action<IIndexerBuilder>?, object?, object?)

Introduces an indexer to the target type, or overrides the implementation of an existing one, by specifying individual template methods for each accessor. Use the With<TNewDeclaration>(TNewDeclaration) method to apply the advice to another declaration than the current one.

IntroduceIndexer(IInterfaceImplementationAdviser, IReadOnlyList<(IType Type, string Name)>, string?, string?, IntroductionScope, OverrideStrategy, Action<IIndexerBuilder>?, object?, object?)

Introduces an indexer to the target type, or overrides the implementation of an existing one, by specifying individual template methods for each accessor. Use the With<TNewDeclaration>(TNewDeclaration) method to apply the advice to another declaration than the current one.

IntroduceIndexer(IInterfaceImplementationAdviser, IReadOnlyList<(Type Type, string Name)>, string?, string?, IntroductionScope, OverrideStrategy, Action<IIndexerBuilder>?, object?, object?)

Introduces an indexer to the target type, or overrides the implementation of an existing one, by specifying individual template methods for each accessor. Use the With<TNewDeclaration>(TNewDeclaration) method to apply the advice to another declaration than the current one.

IntroduceIndexer(IInterfaceImplementationAdviser, Type, string?, string?, IntroductionScope, OverrideStrategy, Action<IIndexerBuilder>?, object?, object?)

Introduces an indexer to the target type, or overrides the implementation of an existing one, by specifying individual template methods for each accessor. Use the With<TNewDeclaration>(TNewDeclaration) method to apply the advice to another declaration than the current one.

IntroduceMethod(IInterfaceImplementationAdviser, string, IntroductionScope, OverrideStrategy, Action<IMethodBuilder>?, object?, object?)

Introduces a new method or overrides the implementation of the existing one. Use the With<TNewDeclaration>(TNewDeclaration) method to apply the advice to another declaration than the current one.

IntroduceProperty(IInterfaceImplementationAdviser, string, IntroductionScope, OverrideStrategy, Action<IPropertyBuilder>?, object?)

Introduces a property to the target type, or overrides the implementation of an existing one, by specifying a property template. Use the With<TNewDeclaration>(TNewDeclaration) method to apply the advice to another declaration than the current one.

IntroduceProperty(IInterfaceImplementationAdviser, string, string?, string?, IntroductionScope, OverrideStrategy, Action<IPropertyBuilder>?, object?, object?)

Introduces a property to the target type, or overrides the implementation of an existing one, by specifying individual template methods for each accessor. Use the With<TNewDeclaration>(TNewDeclaration) method to apply the advice to another declaration than the current one.

IntroduceUnaryOperator(IInterfaceImplementationAdviser, string, IType, IType, OperatorKind, OverrideStrategy, Action<IMethodBuilder>?, object?, object?)

Introduces a unary operator to the target type, or overrides the implementation of an existing one. Use the With<TNewDeclaration>(TNewDeclaration) method to apply the advice to another declaration than the current one.

See Also