Expose TagHelperDescriptors on TagHelperBlock.
- This will enable tooling to determine which descriptors are relevant to which TagHelperBlocks in the syntax tree.
This commit is contained in:
parent
c680833350
commit
170b7a76fd
|
|
@ -6,6 +6,7 @@ using System.Collections.Generic;
|
|||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
||||
using Microsoft.AspNet.Razor.TagHelpers;
|
||||
using Microsoft.AspNet.Razor.Text;
|
||||
using Microsoft.Internal.Web.Utils;
|
||||
|
||||
|
|
@ -27,6 +28,7 @@ namespace Microsoft.AspNet.Razor.Parser.TagHelpers
|
|||
: base(source.Type, source.Children, source.CodeGenerator)
|
||||
{
|
||||
TagName = source.TagName;
|
||||
Descriptors = source.Descriptors;
|
||||
Attributes = new Dictionary<string, SyntaxTreeNode>(source.Attributes);
|
||||
_start = source.Start;
|
||||
|
||||
|
|
@ -38,6 +40,11 @@ namespace Microsoft.AspNet.Razor.Parser.TagHelpers
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <see cref="TagHelperDescriptor"/>s for the HTML element.
|
||||
/// </summary>
|
||||
public IEnumerable<TagHelperDescriptor> Descriptors { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The HTML attributes.
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ namespace Microsoft.AspNet.Razor.Parser.TagHelpers
|
|||
: base(original)
|
||||
{
|
||||
TagName = original.TagName;
|
||||
Descriptors = original.Descriptors;
|
||||
Attributes = new Dictionary<string, SyntaxTreeNode>(original.Attributes);
|
||||
}
|
||||
|
||||
|
|
@ -42,6 +43,7 @@ namespace Microsoft.AspNet.Razor.Parser.TagHelpers
|
|||
public TagHelperBlockBuilder(string tagName, IEnumerable<TagHelperDescriptor> descriptors, Block startTag)
|
||||
{
|
||||
TagName = tagName;
|
||||
Descriptors = descriptors;
|
||||
CodeGenerator = new TagHelperCodeGenerator(descriptors);
|
||||
Type = startTag.Type;
|
||||
Attributes = GetTagAttributes(startTag, descriptors);
|
||||
|
|
@ -67,6 +69,11 @@ namespace Microsoft.AspNet.Razor.Parser.TagHelpers
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <see cref="TagHelperDescriptor"/>s for the HTML element.
|
||||
/// </summary>
|
||||
public IEnumerable<TagHelperDescriptor> Descriptors { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The HTML attributes.
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Reference in New Issue