Fixed a bug in VCTH pass and added an integration test
This commit is contained in:
parent
1efcdafa45
commit
cdddaefa81
|
|
@ -11,9 +11,7 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="..\Microsoft.CodeAnalysis.Razor\ViewComponentTagHelperDescriptorConventions.cs">
|
||||
<Link>ViewComponentTagHelperDescriptorConventions.cs</Link>
|
||||
</Compile>
|
||||
<PackageReference Include="Microsoft.Extensions.HashCodeCombiner.Sources" Version="$(AspNetCoreVersion)" PrivateAssets="All" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
// 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;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
|
|
@ -66,13 +67,11 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
|
|||
ClassDeclarationIRNode @class,
|
||||
CreateTagHelperIRNode node)
|
||||
{
|
||||
var originalTypeName = node.TagHelperTypeName;
|
||||
|
||||
var newTypeName = GetVCTHFullName(@namespace, @class, node.Descriptor);
|
||||
for (var i = 0; i < node.Parent.Children.Count; i++)
|
||||
{
|
||||
var setProperty = node.Parent.Children[i] as SetTagHelperPropertyIRNode;
|
||||
if (setProperty != null)
|
||||
if (node.Parent.Children[i] is SetTagHelperPropertyIRNode setProperty &&
|
||||
node.Descriptor.BoundAttributes.Contains(setProperty.Descriptor))
|
||||
{
|
||||
setProperty.TagHelperTypeName = newTypeName;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
|
||||
[assembly: InternalsVisibleTo("Microsoft.CodeAnalysis.Razor.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Mvc.Razor.Extensions.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.CodeAnalysis.Razor.Workspaces, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.CodeAnalysis.Razor.Workspaces.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
[assembly: InternalsVisibleTo("Microsoft.CodeAnalysis.Remote.Razor, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ namespace Microsoft.CodeAnalysis.Razor
|
|||
/// <summary>
|
||||
/// A library of methods used to generate <see cref="TagHelperDescriptor"/>s for view components.
|
||||
/// </summary>
|
||||
internal static class ViewComponentTagHelperDescriptorConventions
|
||||
public static class ViewComponentTagHelperDescriptorConventions
|
||||
{
|
||||
/// <summary>
|
||||
/// The key in a <see cref="TagHelperDescriptor.Metadata"/> containing
|
||||
|
|
|
|||
|
|
@ -232,6 +232,27 @@ public class DivTagHelper : {typeof(TagHelper).FullName}
|
|||
var references = CreateCompilationReferences(CurrentMvcShim);
|
||||
RunRuntimeTest(references);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ViewComponentTagHelper_Runtime()
|
||||
{
|
||||
var references = CreateCompilationReferences(CurrentMvcShim, appCode: $@"
|
||||
public class TestViewComponent
|
||||
{{
|
||||
public string Invoke(string firstName)
|
||||
{{
|
||||
return firstName;
|
||||
}}
|
||||
}}
|
||||
|
||||
[{typeof(HtmlTargetElementAttribute).FullName}]
|
||||
public class AllTagHelper : {typeof(TagHelper).FullName}
|
||||
{{
|
||||
public string Bar {{ get; set; }}
|
||||
}}
|
||||
");
|
||||
RunRuntimeTest(references);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region DesignTime
|
||||
|
|
@ -454,6 +475,27 @@ public class DivTagHelper : {typeof(TagHelper).FullName}
|
|||
var references = CreateCompilationReferences(CurrentMvcShim);
|
||||
RunDesignTimeTest(references);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ViewComponentTagHelper_DesignTime()
|
||||
{
|
||||
var references = CreateCompilationReferences(CurrentMvcShim, appCode: $@"
|
||||
public class TestViewComponent
|
||||
{{
|
||||
public string Invoke(string firstName)
|
||||
{{
|
||||
return firstName;
|
||||
}}
|
||||
}}
|
||||
|
||||
[{typeof(HtmlTargetElementAttribute).FullName}]
|
||||
public class AllTagHelper : {typeof(TagHelper).FullName}
|
||||
{{
|
||||
public string Bar {{ get; set; }}
|
||||
}}
|
||||
");
|
||||
RunDesignTimeTest(references);
|
||||
}
|
||||
#endregion
|
||||
|
||||
private void RunRuntimeTest(
|
||||
|
|
@ -538,7 +580,7 @@ public class DivTagHelper : {typeof(TagHelper).FullName}
|
|||
b.Features.Add(GetMetadataReferenceFeature(references));
|
||||
b.Features.Add(new CompilationTagHelperFeature());
|
||||
b.Features.Add(new DefaultTagHelperDescriptorProvider() { DesignTime = true });
|
||||
b.Features.Add(new ViewComponentTagHelperDescriptorProvider());
|
||||
b.Features.Add(new ViewComponentTagHelperDescriptorProvider() { ForceEnabled = true });
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -551,7 +593,7 @@ public class DivTagHelper : {typeof(TagHelper).FullName}
|
|||
b.Features.Add(GetMetadataReferenceFeature(references));
|
||||
b.Features.Add(new CompilationTagHelperFeature());
|
||||
b.Features.Add(new DefaultTagHelperDescriptorProvider() { DesignTime = true });
|
||||
b.Features.Add(new ViewComponentTagHelperDescriptorProvider());
|
||||
b.Features.Add(new ViewComponentTagHelperDescriptorProvider() { ForceEnabled = true });
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,3 +2,7 @@
|
|||
Hello world
|
||||
@string.Format("{0}", "Hello")
|
||||
</div>
|
||||
@{
|
||||
var cls = "foo";
|
||||
}
|
||||
<p class="@if(cls != null) { @cls }" />
|
||||
|
|
|
|||
|
|
@ -27,6 +27,27 @@ namespace AspNetCore
|
|||
#line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml"
|
||||
__o = string.Format("{0}", "Hello");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 5 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml"
|
||||
|
||||
var cls = "foo";
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 8 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml"
|
||||
if(cls != null) {
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 8 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml"
|
||||
__o = cls;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 8 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,6 +42,21 @@ Document -
|
|||
RazorIRToken - (83:2,34 [2] Basic.cshtml) - Html - \n
|
||||
RazorIRToken - (85:3,0 [6] Basic.cshtml) - Html - </div>
|
||||
RazorIRToken - (91:3,6 [2] Basic.cshtml) - Html - \n
|
||||
CSharpStatement - (95:4,2 [25] Basic.cshtml)
|
||||
RazorIRToken - (95:4,2 [25] Basic.cshtml) - CSharp - \n var cls = "foo";\n
|
||||
HtmlContent - (123:7,0 [2] Basic.cshtml)
|
||||
RazorIRToken - (123:7,0 [2] Basic.cshtml) - Html - <p
|
||||
HtmlAttribute - (125:7,2 [34] Basic.cshtml) - class=" - "
|
||||
CSharpAttributeValue - (133:7,10 [25] Basic.cshtml) -
|
||||
CSharpStatement - (134:7,11 [18] Basic.cshtml)
|
||||
RazorIRToken - (134:7,11 [18] Basic.cshtml) - CSharp - if(cls != null) {
|
||||
CSharpExpression - (153:7,30 [3] Basic.cshtml)
|
||||
RazorIRToken - (153:7,30 [3] Basic.cshtml) - CSharp - cls
|
||||
CSharpStatement - (156:7,33 [2] Basic.cshtml)
|
||||
RazorIRToken - (156:7,33 [2] Basic.cshtml) - CSharp - }
|
||||
HtmlContent - (159:7,36 [5] Basic.cshtml)
|
||||
RazorIRToken - (159:7,36 [3] Basic.cshtml) - Html - />
|
||||
RazorIRToken - (162:7,39 [2] Basic.cshtml) - Html - \n
|
||||
InjectDirective -
|
||||
InjectDirective -
|
||||
InjectDirective -
|
||||
|
|
|
|||
|
|
@ -8,3 +8,27 @@ Source Location: (54:2,5 [29] TestFiles/IntegrationTests/CodeGenerationIntegrati
|
|||
Generated Location: (1045:27,6 [29] )
|
||||
|string.Format("{0}", "Hello")|
|
||||
|
||||
Source Location: (95:4,2 [25] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml)
|
||||
|
|
||||
var cls = "foo";
|
||||
|
|
||||
Generated Location: (1191:32,2 [25] )
|
||||
|
|
||||
var cls = "foo";
|
||||
|
|
||||
|
||||
Source Location: (134:7,11 [18] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml)
|
||||
|if(cls != null) { |
|
||||
Generated Location: (1339:38,11 [18] )
|
||||
|if(cls != null) { |
|
||||
|
||||
Source Location: (153:7,30 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml)
|
||||
|cls|
|
||||
Generated Location: (1501:43,30 [3] )
|
||||
|cls|
|
||||
|
||||
Source Location: (156:7,33 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml)
|
||||
| }|
|
||||
Generated Location: (1652:48,33 [2] )
|
||||
| }|
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "fd421120502bfd80d21169d04fd6ba54b5cc7f12"
|
||||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "4120ddad9d4353ed260e0585fe71080d78ff8ab3"
|
||||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
|
|
@ -37,6 +37,40 @@ Write(string.Format("{0}", "Hello"));
|
|||
BeginContext(83, 10, true);
|
||||
WriteLiteral("\r\n</div>\r\n");
|
||||
EndContext();
|
||||
#line 5 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml"
|
||||
|
||||
var cls = "foo";
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
BeginContext(123, 2, true);
|
||||
WriteLiteral("<p");
|
||||
EndContext();
|
||||
BeginWriteAttribute("class", " class=\"", 125, "\"", 158, 1);
|
||||
WriteAttributeValue("", 133, new Microsoft.AspNetCore.Mvc.Razor.HelperResult(async(__razor_attribute_value_writer) => {
|
||||
PushWriter(__razor_attribute_value_writer);
|
||||
#line 8 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml"
|
||||
if(cls != null) {
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 8 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml"
|
||||
Write(cls);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 8 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
PopWriter();
|
||||
}
|
||||
), 133, 25, false);
|
||||
EndWriteAttribute();
|
||||
BeginContext(159, 5, true);
|
||||
WriteLiteral(" />\r\n");
|
||||
EndContext();
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
|
||||
|
|
|
|||
|
|
@ -42,6 +42,29 @@ Document -
|
|||
RazorIRToken - (91:3,6 [2] Basic.cshtml) - Html - \n
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - EndContext();
|
||||
CSharpStatement - (95:4,2 [25] Basic.cshtml)
|
||||
RazorIRToken - (95:4,2 [25] Basic.cshtml) - CSharp - \n var cls = "foo";\n
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - BeginContext(123, 2, true);
|
||||
HtmlContent - (123:7,0 [2] Basic.cshtml)
|
||||
RazorIRToken - (123:7,0 [2] Basic.cshtml) - Html - <p
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - EndContext();
|
||||
HtmlAttribute - (125:7,2 [34] Basic.cshtml) - class=" - "
|
||||
CSharpAttributeValue - (133:7,10 [25] Basic.cshtml) -
|
||||
CSharpStatement - (134:7,11 [18] Basic.cshtml)
|
||||
RazorIRToken - (134:7,11 [18] Basic.cshtml) - CSharp - if(cls != null) {
|
||||
CSharpExpression - (153:7,30 [3] Basic.cshtml)
|
||||
RazorIRToken - (153:7,30 [3] Basic.cshtml) - CSharp - cls
|
||||
CSharpStatement - (156:7,33 [2] Basic.cshtml)
|
||||
RazorIRToken - (156:7,33 [2] Basic.cshtml) - CSharp - }
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - BeginContext(159, 5, true);
|
||||
HtmlContent - (159:7,36 [5] Basic.cshtml)
|
||||
RazorIRToken - (159:7,36 [3] Basic.cshtml) - Html - />
|
||||
RazorIRToken - (162:7,39 [2] Basic.cshtml) - Html - \n
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - EndContext();
|
||||
InjectDirective -
|
||||
InjectDirective -
|
||||
InjectDirective -
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
@addTagHelper "*, AppCode"
|
||||
@{
|
||||
var foo = "Hello";
|
||||
}
|
||||
|
||||
<vc:test first-name="@foo" bar=" World"></vc:test>
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
using TModel = global::System.Object;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
using Microsoft.AspNetCore.Mvc.ViewFeatures;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic>
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
((System.Action)(() => {
|
||||
global::System.Object __typeHelper = "*, AppCode";
|
||||
}
|
||||
))();
|
||||
}
|
||||
#pragma warning restore 219
|
||||
private static System.Object __o = null;
|
||||
private global::AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper_cshtml.__Generated__TestViewComponentTagHelper __AspNetCore_TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper_cshtml___Generated__TestViewComponentTagHelper = null;
|
||||
private global::AllTagHelper __AllTagHelper = null;
|
||||
#pragma warning disable 1998
|
||||
public async override global::System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
#line 2 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper.cshtml"
|
||||
|
||||
var foo = "Hello";
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__AspNetCore_TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper_cshtml___Generated__TestViewComponentTagHelper = CreateTagHelper<global::AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper_cshtml.__Generated__TestViewComponentTagHelper>();
|
||||
__AllTagHelper = CreateTagHelper<global::AllTagHelper>();
|
||||
#line 6 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper.cshtml"
|
||||
__o = foo;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__AspNetCore_TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper_cshtml___Generated__TestViewComponentTagHelper.firstName = string.Empty;
|
||||
__AllTagHelper.Bar = " World";
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
|
||||
public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; }
|
||||
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
|
||||
public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; }
|
||||
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
|
||||
public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; }
|
||||
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
|
||||
public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; }
|
||||
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
|
||||
public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<dynamic> Html { get; private set; }
|
||||
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElementAttribute("vc:test")]
|
||||
public class __Generated__TestViewComponentTagHelper : Microsoft.AspNetCore.Razor.TagHelpers.TagHelper
|
||||
{
|
||||
private readonly global::Microsoft.AspNetCore.Mvc.IViewComponentHelper _helper = null;
|
||||
public __Generated__TestViewComponentTagHelper(global::Microsoft.AspNetCore.Mvc.IViewComponentHelper helper)
|
||||
{
|
||||
_helper = helper;
|
||||
}
|
||||
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeNotBoundAttribute, global::Microsoft.AspNetCore.Mvc.ViewFeatures.ViewContextAttribute]
|
||||
public global::Microsoft.AspNetCore.Mvc.Rendering.ViewContext ViewContext { get; set; }
|
||||
public System.String firstName { get; set; }
|
||||
public override async global::System.Threading.Tasks.Task ProcessAsync(Microsoft.AspNetCore.Razor.TagHelpers.TagHelperContext context, Microsoft.AspNetCore.Razor.TagHelpers.TagHelperOutput output)
|
||||
{
|
||||
(_helper as global::Microsoft.AspNetCore.Mvc.ViewFeatures.IViewContextAware)?.Contextualize(ViewContext);
|
||||
var content = await _helper.InvokeAsync("Test", new { firstName });
|
||||
output.TagName = null;
|
||||
output.Content.SetHtmlContent(content);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
Document -
|
||||
Checksum -
|
||||
NamespaceDeclaration - - AspNetCore
|
||||
UsingStatement - - TModel = global::System.Object
|
||||
UsingStatement - (1:0,1 [12] ) - System
|
||||
UsingStatement - (16:1,1 [32] ) - System.Collections.Generic
|
||||
UsingStatement - (51:2,1 [17] ) - System.Linq
|
||||
UsingStatement - (71:3,1 [28] ) - System.Threading.Tasks
|
||||
UsingStatement - (102:4,1 [30] ) - Microsoft.AspNetCore.Mvc
|
||||
UsingStatement - (135:5,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering
|
||||
UsingStatement - (178:6,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures
|
||||
ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper_cshtml - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic> -
|
||||
DesignTimeDirective -
|
||||
DirectiveToken - (231:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<TModel>
|
||||
DirectiveToken - (294:7,71 [4] ) - Html
|
||||
DirectiveToken - (308:8,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper
|
||||
DirectiveToken - (363:8,63 [4] ) - Json
|
||||
DirectiveToken - (377:9,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper
|
||||
DirectiveToken - (431:9,62 [9] ) - Component
|
||||
DirectiveToken - (450:10,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper
|
||||
DirectiveToken - (494:10,52 [3] ) - Url
|
||||
DirectiveToken - (507:11,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider
|
||||
DirectiveToken - (578:11,79 [23] ) - ModelExpressionProvider
|
||||
DirectiveToken - (617:12,14 [96] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor
|
||||
DirectiveToken - (729:13,14 [87] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor
|
||||
DirectiveToken - (832:14,14 [87] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor
|
||||
DirectiveToken - (14:0,14 [12] ViewComponentTagHelper.cshtml) - "*, AppCode"
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - private static System.Object __o = null;
|
||||
DeclareTagHelperFields - - AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper_cshtml.__Generated__TestViewComponentTagHelper - AllTagHelper
|
||||
MethodDeclaration - - public - async, override - global::System.Threading.Tasks.Task - ExecuteAsync
|
||||
HtmlContent - (26:0,26 [2] ViewComponentTagHelper.cshtml)
|
||||
RazorIRToken - (26:0,26 [2] ViewComponentTagHelper.cshtml) - Html - \n
|
||||
CSharpStatement - (30:1,2 [26] ViewComponentTagHelper.cshtml)
|
||||
RazorIRToken - (30:1,2 [26] ViewComponentTagHelper.cshtml) - CSharp - \n var foo = "Hello";\n
|
||||
HtmlContent - (59:4,0 [2] ViewComponentTagHelper.cshtml)
|
||||
RazorIRToken - (59:4,0 [2] ViewComponentTagHelper.cshtml) - Html - \n
|
||||
TagHelper - (61:5,0 [50] ViewComponentTagHelper.cshtml) - vc:test - TagMode.StartTagAndEndTag
|
||||
TagHelperBody -
|
||||
CreateTagHelper - - AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper_cshtml.__Generated__TestViewComponentTagHelper
|
||||
CreateTagHelper - - AllTagHelper
|
||||
SetTagHelperProperty - (82:5,21 [4] ViewComponentTagHelper.cshtml) - first-name - firstName - HtmlAttributeValueStyle.DoubleQuotes
|
||||
CSharpExpression - (83:5,22 [3] ViewComponentTagHelper.cshtml)
|
||||
RazorIRToken - (83:5,22 [3] ViewComponentTagHelper.cshtml) - CSharp - foo
|
||||
SetTagHelperProperty - (93:5,32 [6] ViewComponentTagHelper.cshtml) - bar - Bar - HtmlAttributeValueStyle.DoubleQuotes
|
||||
HtmlContent - (93:5,32 [6] ViewComponentTagHelper.cshtml)
|
||||
RazorIRToken - (93:5,32 [6] ViewComponentTagHelper.cshtml) - Html - World
|
||||
InjectDirective -
|
||||
InjectDirective -
|
||||
InjectDirective -
|
||||
InjectDirective -
|
||||
InjectDirective -
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - [Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElementAttribute("vc:test")]\npublic class __Generated__TestViewComponentTagHelper : Microsoft.AspNetCore.Razor.TagHelpers.TagHelper\n{\n private readonly global::Microsoft.AspNetCore.Mvc.IViewComponentHelper _helper = null;\n public __Generated__TestViewComponentTagHelper(global::Microsoft.AspNetCore.Mvc.IViewComponentHelper helper)\n {\n _helper = helper;\n }\n [Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeNotBoundAttribute, global::Microsoft.AspNetCore.Mvc.ViewFeatures.ViewContextAttribute]\n public global::Microsoft.AspNetCore.Mvc.Rendering.ViewContext ViewContext { get; set; }\n public System.String firstName { get; set; }\n public override async global::System.Threading.Tasks.Task ProcessAsync(Microsoft.AspNetCore.Razor.TagHelpers.TagHelperContext context, Microsoft.AspNetCore.Razor.TagHelpers.TagHelperOutput output)\n {\n (_helper as global::Microsoft.AspNetCore.Mvc.ViewFeatures.IViewContextAware)?.Contextualize(ViewContext);\n var content = await _helper.InvokeAsync("Test", new { firstName });\n output.TagName = null;\n output.Content.SetHtmlContent(content);\n }\n}\n
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
Source Location: (14:0,14 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper.cshtml)
|
||||
|"*, AppCode"|
|
||||
Generated Location: (674:16,37 [12] )
|
||||
|"*, AppCode"|
|
||||
|
||||
Source Location: (30:1,2 [26] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper.cshtml)
|
||||
|
|
||||
var foo = "Hello";
|
||||
|
|
||||
Generated Location: (1416:28,2 [26] )
|
||||
|
|
||||
var foo = "Hello";
|
||||
|
|
||||
|
||||
Source Location: (83:5,22 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper.cshtml)
|
||||
|foo|
|
||||
Generated Location: (1985:36,22 [3] )
|
||||
|foo|
|
||||
|
||||
|
|
@ -0,0 +1,107 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "6a0ad3c59f3a87877c36928472f0508bd40cdd8c"
|
||||
namespace AspNetCore
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
using Microsoft.AspNetCore.Mvc.ViewFeatures;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic>
|
||||
{
|
||||
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("bar", " World", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
#line hidden
|
||||
#pragma warning disable 0414
|
||||
private string __tagHelperStringValueBuffer = null;
|
||||
#pragma warning restore 0414
|
||||
private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext __tagHelperExecutionContext = null;
|
||||
private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner __tagHelperRunner = new global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner();
|
||||
private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager __backed__tagHelperScopeManager = null;
|
||||
private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager __tagHelperScopeManager
|
||||
{
|
||||
get
|
||||
{
|
||||
if (__backed__tagHelperScopeManager == null)
|
||||
{
|
||||
__backed__tagHelperScopeManager = new global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager(StartTagHelperWritingScope, EndTagHelperWritingScope);
|
||||
}
|
||||
return __backed__tagHelperScopeManager;
|
||||
}
|
||||
}
|
||||
private global::AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper_cshtml.__Generated__TestViewComponentTagHelper __AspNetCore_TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper_cshtml___Generated__TestViewComponentTagHelper = null;
|
||||
private global::AllTagHelper __AllTagHelper = null;
|
||||
#pragma warning disable 1998
|
||||
public async override global::System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
#line 2 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper.cshtml"
|
||||
|
||||
var foo = "Hello";
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
BeginContext(59, 2, true);
|
||||
WriteLiteral("\r\n");
|
||||
EndContext();
|
||||
BeginContext(61, 50, false);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("vc:test", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => {
|
||||
}
|
||||
);
|
||||
__AspNetCore_TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper_cshtml___Generated__TestViewComponentTagHelper = CreateTagHelper<global::AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper_cshtml.__Generated__TestViewComponentTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__AspNetCore_TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper_cshtml___Generated__TestViewComponentTagHelper);
|
||||
__AllTagHelper = CreateTagHelper<global::AllTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__AllTagHelper);
|
||||
BeginWriteTagHelperAttribute();
|
||||
#line 6 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper.cshtml"
|
||||
WriteLiteral(foo);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__AspNetCore_TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper_cshtml___Generated__TestViewComponentTagHelper.firstName = __tagHelperStringValueBuffer;
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("first-name", __AspNetCore_TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper_cshtml___Generated__TestViewComponentTagHelper.firstName, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
__AllTagHelper.Bar = (string)__tagHelperAttribute_0.Value;
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
EndContext();
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
|
||||
public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; }
|
||||
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
|
||||
public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; }
|
||||
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
|
||||
public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; }
|
||||
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
|
||||
public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; }
|
||||
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
|
||||
public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<dynamic> Html { get; private set; }
|
||||
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElementAttribute("vc:test")]
|
||||
public class __Generated__TestViewComponentTagHelper : Microsoft.AspNetCore.Razor.TagHelpers.TagHelper
|
||||
{
|
||||
private readonly global::Microsoft.AspNetCore.Mvc.IViewComponentHelper _helper = null;
|
||||
public __Generated__TestViewComponentTagHelper(global::Microsoft.AspNetCore.Mvc.IViewComponentHelper helper)
|
||||
{
|
||||
_helper = helper;
|
||||
}
|
||||
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeNotBoundAttribute, global::Microsoft.AspNetCore.Mvc.ViewFeatures.ViewContextAttribute]
|
||||
public global::Microsoft.AspNetCore.Mvc.Rendering.ViewContext ViewContext { get; set; }
|
||||
public System.String firstName { get; set; }
|
||||
public override async global::System.Threading.Tasks.Task ProcessAsync(Microsoft.AspNetCore.Razor.TagHelpers.TagHelperContext context, Microsoft.AspNetCore.Razor.TagHelpers.TagHelperOutput output)
|
||||
{
|
||||
(_helper as global::Microsoft.AspNetCore.Mvc.ViewFeatures.IViewContextAware)?.Contextualize(ViewContext);
|
||||
var content = await _helper.InvokeAsync("Test", new { firstName });
|
||||
output.TagName = null;
|
||||
output.Content.SetHtmlContent(content);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
Document -
|
||||
Checksum -
|
||||
NamespaceDeclaration - - AspNetCore
|
||||
UsingStatement - (1:0,1 [14] ) - System
|
||||
UsingStatement - (16:1,1 [34] ) - System.Collections.Generic
|
||||
UsingStatement - (51:2,1 [19] ) - System.Linq
|
||||
UsingStatement - (71:3,1 [30] ) - System.Threading.Tasks
|
||||
UsingStatement - (102:4,1 [32] ) - Microsoft.AspNetCore.Mvc
|
||||
UsingStatement - (135:5,1 [42] ) - Microsoft.AspNetCore.Mvc.Rendering
|
||||
UsingStatement - (178:6,1 [45] ) - Microsoft.AspNetCore.Mvc.ViewFeatures
|
||||
ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper_cshtml - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic> -
|
||||
DeclarePreallocatedTagHelperAttribute - - __tagHelperAttribute_0 - bar - World - HtmlAttributeValueStyle.DoubleQuotes
|
||||
DeclareTagHelperFields - - AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper_cshtml.__Generated__TestViewComponentTagHelper - AllTagHelper
|
||||
MethodDeclaration - - public - async, override - global::System.Threading.Tasks.Task - ExecuteAsync
|
||||
CSharpStatement - (30:1,2 [26] ViewComponentTagHelper.cshtml)
|
||||
RazorIRToken - (30:1,2 [26] ViewComponentTagHelper.cshtml) - CSharp - \n var foo = "Hello";\n
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - BeginContext(59, 2, true);
|
||||
HtmlContent - (59:4,0 [2] ViewComponentTagHelper.cshtml)
|
||||
RazorIRToken - (59:4,0 [2] ViewComponentTagHelper.cshtml) - Html - \n
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - EndContext();
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - BeginContext(61, 50, false);
|
||||
TagHelper - (61:5,0 [50] ViewComponentTagHelper.cshtml) - vc:test - TagMode.StartTagAndEndTag
|
||||
TagHelperBody -
|
||||
CreateTagHelper - - AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper_cshtml.__Generated__TestViewComponentTagHelper
|
||||
CreateTagHelper - - AllTagHelper
|
||||
SetTagHelperProperty - (82:5,21 [4] ViewComponentTagHelper.cshtml) - first-name - firstName - HtmlAttributeValueStyle.DoubleQuotes
|
||||
CSharpExpression - (83:5,22 [3] ViewComponentTagHelper.cshtml)
|
||||
RazorIRToken - (83:5,22 [3] ViewComponentTagHelper.cshtml) - CSharp - foo
|
||||
SetPreallocatedTagHelperProperty - - __tagHelperAttribute_0 - bar - Bar
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - EndContext();
|
||||
InjectDirective -
|
||||
InjectDirective -
|
||||
InjectDirective -
|
||||
InjectDirective -
|
||||
InjectDirective -
|
||||
CSharpStatement -
|
||||
RazorIRToken - - CSharp - [Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElementAttribute("vc:test")]\npublic class __Generated__TestViewComponentTagHelper : Microsoft.AspNetCore.Razor.TagHelpers.TagHelper\n{\n private readonly global::Microsoft.AspNetCore.Mvc.IViewComponentHelper _helper = null;\n public __Generated__TestViewComponentTagHelper(global::Microsoft.AspNetCore.Mvc.IViewComponentHelper helper)\n {\n _helper = helper;\n }\n [Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeNotBoundAttribute, global::Microsoft.AspNetCore.Mvc.ViewFeatures.ViewContextAttribute]\n public global::Microsoft.AspNetCore.Mvc.Rendering.ViewContext ViewContext { get; set; }\n public System.String firstName { get; set; }\n public override async global::System.Threading.Tasks.Task ProcessAsync(Microsoft.AspNetCore.Razor.TagHelpers.TagHelperContext context, Microsoft.AspNetCore.Razor.TagHelpers.TagHelperOutput output)\n {\n (_helper as global::Microsoft.AspNetCore.Mvc.ViewFeatures.IViewContextAware)?.Contextualize(ViewContext);\n var content = await _helper.InvokeAsync("Test", new { firstName });\n output.TagName = null;\n output.Content.SetHtmlContent(content);\n }\n}\n
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
// 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;
|
||||
using System.IO;
|
||||
using System.Text.Encodings.Web;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Html;
|
||||
|
||||
namespace Microsoft.AspNetCore.Mvc.Razor
|
||||
{
|
||||
public class HelperResult : IHtmlContent
|
||||
{
|
||||
public HelperResult(Func<TextWriter, Task> asyncAction)
|
||||
{
|
||||
}
|
||||
|
||||
public void WriteTo(TextWriter writer, HtmlEncoder encoder)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -51,6 +51,15 @@ namespace Microsoft.AspNetCore.Mvc.Razor
|
|||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
protected virtual void PushWriter(TextWriter writer)
|
||||
{
|
||||
}
|
||||
|
||||
protected virtual TextWriter PopWriter()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void StartTagHelperWritingScope(HtmlEncoder encoder)
|
||||
{
|
||||
}
|
||||
|
|
@ -82,34 +91,10 @@ namespace Microsoft.AspNetCore.Mvc.Razor
|
|||
{
|
||||
}
|
||||
|
||||
public virtual void WriteTo(TextWriter writer, object value)
|
||||
{
|
||||
}
|
||||
|
||||
public static void WriteTo(TextWriter writer, HtmlEncoder encoder, object value)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void WriteTo(TextWriter writer, string value)
|
||||
{
|
||||
}
|
||||
|
||||
private static void WriteTo(TextWriter writer, HtmlEncoder encoder, string value)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void WriteLiteral(object value)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void WriteLiteralTo(TextWriter writer, object value)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void WriteLiteralTo(TextWriter writer, string value)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void BeginWriteAttribute(
|
||||
string name,
|
||||
string prefix,
|
||||
|
|
@ -120,17 +105,6 @@ namespace Microsoft.AspNetCore.Mvc.Razor
|
|||
{
|
||||
}
|
||||
|
||||
public virtual void BeginWriteAttributeTo(
|
||||
TextWriter writer,
|
||||
string name,
|
||||
string prefix,
|
||||
int prefixOffset,
|
||||
string suffix,
|
||||
int suffixOffset,
|
||||
int attributeValuesCount)
|
||||
{
|
||||
}
|
||||
|
||||
public void WriteAttributeValue(
|
||||
string prefix,
|
||||
int prefixOffset,
|
||||
|
|
@ -141,25 +115,10 @@ namespace Microsoft.AspNetCore.Mvc.Razor
|
|||
{
|
||||
}
|
||||
|
||||
public void WriteAttributeValueTo(
|
||||
TextWriter writer,
|
||||
string prefix,
|
||||
int prefixOffset,
|
||||
object value,
|
||||
int valueOffset,
|
||||
int valueLength,
|
||||
bool isLiteral)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void EndWriteAttribute()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void EndWriteAttributeTo(TextWriter writer)
|
||||
{
|
||||
}
|
||||
|
||||
public void BeginAddHtmlAttributeValues(
|
||||
TagHelperExecutionContext executionContext,
|
||||
string attributeName,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
// 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 Microsoft.AspNetCore.Mvc.Rendering;
|
||||
|
||||
namespace Microsoft.AspNetCore.Mvc.ViewFeatures
|
||||
{
|
||||
public interface IViewContextAware
|
||||
{
|
||||
void Contextualize(ViewContext viewContext);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
// 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.Mvc.ViewFeatures
|
||||
{
|
||||
public class ViewContextAttribute : Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
@ -1,10 +1,16 @@
|
|||
// 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;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Html;
|
||||
|
||||
namespace Microsoft.AspNetCore.Mvc
|
||||
{
|
||||
public interface IViewComponentHelper
|
||||
{
|
||||
Task<IHtmlContent> InvokeAsync(string name, object arguments);
|
||||
|
||||
Task<IHtmlContent> InvokeAsync(Type componentType, object arguments);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue