Open sandboxFocus

Class OverrideMethodMulticastAspect

An aspect equivalent to OverrideMethodAspect that also implements multicasting for backward compatibility with PostSharp.

Inheritance
OverrideMethodMulticastAspect
Namespace: Metalama.Extensions.Multicast
Assembly: Metalama.Extensions.Multicast.dll
Syntax
[AttributeUsage(AttributeTargets.Assembly|AttributeTargets.Class|AttributeTargets.Struct|AttributeTargets.Method|AttributeTargets.Property|AttributeTargets.Event, AllowMultiple = true)]
public abstract class OverrideMethodMulticastAspect : MulticastAspect, IMulticastAttribute, IAspect<ICompilation>, IEligible<ICompilation>, IAspect<INamedType>, IEligible<INamedType>, IAspect<IProperty>, IEligible<IProperty>, IAspect<IEvent>, IEligible<IEvent>, IAspect<IMethod>, IAspect, ICompileTimeSerializable, ITemplateProvider, IEligible<IMethod>
Remarks

This class combines the method overriding capabilities of OverrideMethodAspect with the multicasting features provided by MulticastAspect. It can be applied to methods, properties, events, types, or assemblies, and will automatically apply to matching method accessors based on the multicasting filter properties inherited from IMulticastAttribute.

For details on the template system, template selection, and best practices, see the documentation of OverrideMethodAspect.

Constructors

Name Description
OverrideMethodMulticastAspect()

Initializes a new instance of the OverrideMethodMulticastAspect class.

Properties

Name Description
UseAsyncTemplateForAnyAwaitable

Gets or sets a value indicating whether async templates should be selected based on return type rather than the async modifier. See OverrideMethodAspect for details.

UseEnumerableTemplateForAnyEnumerable

Gets or sets a value indicating whether enumerable templates should be selected based on return type rather than the yield modifier. See OverrideMethodAspect for details.

Methods

Name Description
BuildAspect(IAspectBuilder<IEvent>)

Defines the aspect implementation by adding advice, child aspects, and validators to the target declaration.

BuildAspect(IAspectBuilder<IMethod>)

Defines the aspect implementation by adding advice, child aspects, and validators to the target declaration.

BuildAspect(IAspectBuilder<IProperty>)

Defines the aspect implementation by adding advice, child aspects, and validators to the target declaration.

BuildEligibility(IEligibilityBuilder<IEvent>)

Configures the eligibility of the aspect or attribute by defining rules that determine which declarations the aspect can be applied to.

BuildEligibility(IEligibilityBuilder<IMethod>)

Configures the eligibility of the aspect or attribute by defining rules that determine which declarations the aspect can be applied to.

BuildEligibility(IEligibilityBuilder<IProperty>)

Configures the eligibility of the aspect or attribute by defining rules that determine which declarations the aspect can be applied to.

OverrideAsyncEnumerableMethod()

Template for overriding methods returning IAsyncEnumerable<T>. See OverrideMethodAspect for details.

OverrideAsyncEnumeratorMethod()

Template for overriding methods returning IAsyncEnumerator<T>. See OverrideMethodAspect for details.

OverrideAsyncMethod()

Template for overriding asynchronous methods. See OverrideAsyncMethod() for details.

OverrideEnumerableMethod()

Template for overriding methods returning IEnumerable<T>. See OverrideEnumerableMethod() for details.

OverrideEnumeratorMethod()

Template for overriding methods returning IEnumerator<T>. See OverrideEnumeratorMethod() for details.

OverrideMethod()

The default template for overriding method implementations. See OverrideMethod() for details.

Extension Methods

See Also