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.
Implements
Namespace: Metalama.Framework.Advising
Assembly: Metalama.Framework.dll
Syntax
[CompileTime]
public sealed record TemplateAttributeProperties : IEquatable<TemplateAttributeProperties>Remarks
This record is used by ITemplateAttribute to store configuration properties for template members. It supports progressive enhancement of template attributes in future versions by encapsulating all configuration in a single object.
Constructors
| Name | Description |
|---|---|
| TemplateAttributeProperties(string?, Accessibility?, bool?, bool?, bool?, bool?, bool?, bool?, string?) | 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 |
Properties
| Name | Description |
|---|---|
| Accessibility | The accessibility level of the introduced member (e.g., public, private, protected). When |
| Id | An identifier that can be used to reference this template from advising methods. When set, this identifier can be passed to advising methods such as IntroduceMethod(IAdviser<INamedType>, string, IntroductionScope, OverrideStrategy, Action<IMethodBuilder>?, object?, object?) instead of the member name. This allows referencing templates by a stable identifier, which is useful when templates are defined in a separate assembly from the code that uses them. |
| IsAbstract | A value indicating whether the introduced member is abstract. When |
| IsExtern | A value indicating whether the introduced member is extern. When |
| IsPartial | A value indicating whether the introduced member is partial. When |
| IsRequired | A value indicating whether the introduced member is required (C# 11+ feature). When |
| IsSealed | A value indicating whether the introduced member is sealed. When |
| IsVirtual | A value indicating whether the introduced member is virtual. When |
| Name | The name of the introduced member. When |
Methods
Operators
| Name | Description |
|---|---|
| operator ==(TemplateAttributeProperties?, TemplateAttributeProperties?) | |
| operator !=(TemplateAttributeProperties?, TemplateAttributeProperties?) |