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 null, its value is inherited from the template member itself.
Declaration
public TemplateAttributeProperties(string? Name = null, Accessibility? Accessibility = null, bool? IsVirtual = null, bool? IsSealed = null, bool? IsRequired = null, bool? IsAbstract = null, bool? IsPartial = null, bool? IsExtern = null, string? Id = null)Parameters
| Type | Name | Description |
|---|---|---|
| string | Name | The name of the introduced member. When |
| Accessibility? | Accessibility | The accessibility level of the introduced member (e.g., public, private, protected). When |
| bool? | IsVirtual | A value indicating whether the introduced member is virtual. When |
| bool? | IsSealed | A value indicating whether the introduced member is sealed. When |
| bool? | IsRequired | A value indicating whether the introduced member is required (C# 11+ feature). When |
| bool? | IsAbstract | A value indicating whether the introduced member is abstract. When |
| bool? | IsPartial | A value indicating whether the introduced member is partial. When |
| bool? | IsExtern | A value indicating whether the introduced member is extern. When |
| string | 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. |
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.