A reusable implementation of the multicasting logic. Multicast-enabled aspects can contain an instance of this class and call its BuildAspect<T>(IAspectBuilder<T>, Action<IAspectBuilder<T>>?) method to perform multicasting.
Namespace: Metalama.Extensions.Multicast
Assembly: Metalama.Extensions.Multicast.dll
Syntax
[CompileTime]
public sealed class MulticastImplementationRemarks
This class provides the core multicasting functionality that enables aspects to be applied at the assembly or type level and automatically cascade to matching members based on filtering criteria defined through IMulticastAttribute properties.
When using this class directly (rather than deriving from MulticastAspect), your aspect must:
- Implement IMulticastAttribute to expose the filtering properties.
- Implement IAspect<T> for intermediate targets (ICompilation and INamedType) that serve only as entry points for the multicasting process.
- Implement IAspect<T> for final targets (e.g., IMethod, IProperty, IField) where the aspect will actually perform its work.
The multicasting process cascades from parent declarations to children: from assemblies to types, and from types to members. At each level, the BuildAspect<T>(IAspectBuilder<T>, Action<IAspectBuilder<T>>?) method should be called to propagate the aspect to matching child declarations.
Constructors
| Name | Description |
|---|---|
| MulticastImplementation(MulticastTargets, bool) | Initializes a new instance of the MulticastImplementation class. |
Properties
| Name | Description |
|---|---|
| ConcreteTargets | Gets the kind of declarations to which the aspect can be applied. This property is set from the class constructor. |
Methods
| Name | Description |
|---|---|
| BuildAspect<T>(IAspectBuilder<T>, Action<IAspectBuilder<T>>?) | Implements the multicasting logic for a given declaration level. This method must be called from the BuildAspect(IAspectBuilder<T>) method of the aspect class. |