Builder for introducing a new extension block. Inherits from INamedTypeBuilder to allow introducing members, but restricts operations that are not valid for extension blocks.
Namespace: Metalama.Framework.Code.DeclarationBuilders
Assembly: Metalama.Framework.dll
Syntax
[InternalImplement]
public interface IExtensionBlockBuilder : INamedTypeBuilder, IMemberOrNamedTypeBuilder, IDeclarationBuilder, IExtensionBlock, INamedType, IType, IEquatable<IType>, IGeneric, IMemberOrNamedType, INamespaceOrNamedType, INamedDeclaration, IDeclaration, IDisplayable, IDiagnosticLocation, ICompilationElement, IMeasurable, IEquatable<IDeclaration>, IEquatable<INamedType>Remarks
Extension blocks have the following restrictions compared to regular named types:
- Cannot have a base type (always throws on BaseType setter).
- The Name property is used internally to generate deterministic file names for the design-time syntax tree. It is automatically assigned if not set.
- Cannot set accessibility (extension blocks don't have access modifiers).
- Cannot be abstract, sealed, or partial.
- Cannot contain fields (will fail at advice execution time).
- Cannot contain auto-properties (will fail at advice execution time).
- Cannot contain nested types (will fail at advice execution time).
- Cannot contain constructors (will fail at advice execution time).
Properties
| Name | Description |
|---|---|
| ReceiverParameter | Gets the receiver parameter builder. Use this to configure the receiver type and name. |