58 lines
1.6 KiB
C#
58 lines
1.6 KiB
C#
// Copyright (c) .NET Foundation. All rights reserved.
|
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
|
|
|
using System;
|
|
|
|
namespace Microsoft.AspNetCore.Razor.Language.Intermediate
|
|
{
|
|
public sealed class NamespaceDeclarationIRNode : RazorIRNode
|
|
{
|
|
private ItemCollection _annotations;
|
|
private RazorDiagnosticCollection _diagnostics;
|
|
|
|
public override ItemCollection Annotations
|
|
{
|
|
get
|
|
{
|
|
if (_annotations == null)
|
|
{
|
|
_annotations = new DefaultItemCollection();
|
|
}
|
|
|
|
return _annotations;
|
|
}
|
|
}
|
|
|
|
public override RazorDiagnosticCollection Diagnostics
|
|
{
|
|
get
|
|
{
|
|
if (_diagnostics == null)
|
|
{
|
|
_diagnostics = new DefaultDiagnosticCollection();
|
|
}
|
|
|
|
return _diagnostics;
|
|
}
|
|
}
|
|
|
|
public override RazorIRNodeCollection Children { get; } = new DefaultIRNodeCollection();
|
|
|
|
public override SourceSpan? Source { get; set; }
|
|
|
|
public override bool HasDiagnostics => _diagnostics != null && _diagnostics.Count > 0;
|
|
|
|
public string Content { get; set; }
|
|
|
|
public override void Accept(RazorIRNodeVisitor visitor)
|
|
{
|
|
if (visitor == null)
|
|
{
|
|
throw new ArgumentNullException(nameof(visitor));
|
|
}
|
|
|
|
visitor.VisitNamespaceDeclaration(this);
|
|
}
|
|
}
|
|
}
|