InjectDirectiveSyntax
csharp
public sealed class InjectDirectiveSyntax@inject ITheme Theme — the property that reads an ambient value.
Remarks
⚠ Sugar over one line of code-behind, and the mirror of <provide>. It generates private ITheme? Theme => Inject<ITheme>(); and nothing else, so the property is nullable because injection can find nothing — a consumer that needs a fallback still writes the ?? Default in @code. Repeatable, like @using and unlike every other header, because the shape it is for is a file that reads three ambient values.
Fields and properties (3)
public SyntaxToken InjectKeywordpublic SyntaxToken TypeThe ambient key, dotted, carried whole as one token.
public SyntaxToken NameWhat the generated property is called.
Methods (7)
public override SyntaxNode? GetSlot(int index)public override void Accept(SyntaxVisitor visitor)public override TResult Accept<TResult>(SyntaxVisitor<TResult> visitor)public InjectDirectiveSyntax Update(SyntaxToken injectKeyword, SyntaxToken type, SyntaxToken name)public InjectDirectiveSyntax WithInjectKeyword(SyntaxToken injectKeyword)public InjectDirectiveSyntax WithType(SyntaxToken type)public InjectDirectiveSyntax WithName(SyntaxToken name)
Used by (9)
- BinderVixen.Ui.Markup
- DocumentSyntaxVixen.Ui.Markup
- InjectDirectiveSyntaxVixen.Ui.Markup
- ParserTestsVixen.Ui.Markup.Tests
- SyntaxFactoryVixen.Ui.Markup
- SyntaxRewriterVixen.Ui.Markup
- SyntaxVisitorVixen.Ui.Markup
- SyntaxVisitorVixen.Ui.Markup
- VxmlParserVixen.Ui.Markup