| File: Language\Intermediate\DirectiveIntermediateNode.cs | Web Access |
| Project: src\roslyn\src\Razor\src\Compiler\Microsoft.CodeAnalysis.Razor.Compiler\src\Microsoft.CodeAnalysis.Razor.Compiler.csproj (Microsoft.CodeAnalysis.Razor.Compiler) |
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. #nullable disable using System.Collections.Generic; using System.Linq; namespace Microsoft.AspNetCore.Razor.Language.Intermediate; public sealed class DirectiveIntermediateNode : IntermediateNode { public override IntermediateNodeCollection Children { get => field ??= []; } public string DirectiveName { get; set; } public IEnumerable<DirectiveTokenIntermediateNode> Tokens => Children.OfType<DirectiveTokenIntermediateNode>(); public DirectiveDescriptor Directive { get; set; } public override void Accept(IntermediateNodeVisitor visitor) { visitor.VisitDirective(this); } public override void FormatNode(IntermediateNodeFormatter formatter) { formatter.WriteContent(DirectiveName); formatter.WriteProperty(nameof(Directive), Directive?.DisplayName); formatter.WriteProperty(nameof(DirectiveName), DirectiveName); } }