[Fixes #882] Added TagHelper runtime code generation support
This commit is contained in:
parent
f47a40a4a7
commit
9dece91975
|
|
@ -413,7 +413,8 @@ namespace Microsoft.AspNetCore.Razor.Evolution
|
|||
AttributeName = attribute.Name,
|
||||
TagHelperTypeName = associatedDescriptor.TypeName,
|
||||
Descriptor = associatedAttributeDescriptor,
|
||||
ValueStyle = attribute.ValueStyle
|
||||
ValueStyle = attribute.ValueStyle,
|
||||
SourceRange = BuildSourceRangeFromNode(attributeValueNode)
|
||||
};
|
||||
|
||||
Builder.Push(setTagHelperProperty);
|
||||
|
|
|
|||
|
|
@ -12,6 +12,19 @@ namespace Microsoft.AspNetCore.Razor.Evolution
|
|||
{
|
||||
internal class DefaultRazorRuntimeCSharpLoweringPhase : RazorCSharpLoweringPhaseBase
|
||||
{
|
||||
private static string _tagHelperId;
|
||||
|
||||
internal static string GenerateUniqueTagHelperId {
|
||||
get
|
||||
{
|
||||
return _tagHelperId ?? Guid.NewGuid().ToString("N");
|
||||
}
|
||||
set
|
||||
{
|
||||
_tagHelperId = value;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void ExecuteCore(RazorCodeDocument codeDocument)
|
||||
{
|
||||
var irDocument = codeDocument.GetIRDocument();
|
||||
|
|
@ -32,6 +45,7 @@ namespace Microsoft.AspNetCore.Razor.Evolution
|
|||
{
|
||||
GeneratedCode = renderingContext.Writer.GenerateCode(),
|
||||
LineMappings = renderingContext.LineMappings,
|
||||
Diagnostics = renderingContext.ErrorSink.Errors
|
||||
};
|
||||
|
||||
codeDocument.SetCSharpDocument(csharpDocument);
|
||||
|
|
@ -170,7 +184,7 @@ namespace Microsoft.AspNetCore.Razor.Evolution
|
|||
{
|
||||
const string ValueWriterName = "__razor_attribute_value_writer";
|
||||
|
||||
var expressionValue = node.Children.First() as CSharpExpressionIRNode;
|
||||
var expressionValue = node.Children.FirstOrDefault() as CSharpExpressionIRNode;
|
||||
var linePragma = expressionValue != null ? new LinePragmaWriter(Context.Writer, node.SourceRange) : null;
|
||||
var prefixLocation = node.SourceRange.AbsoluteIndex;
|
||||
var valueLocation = node.SourceRange.AbsoluteIndex + node.Prefix.Length;
|
||||
|
|
@ -194,8 +208,7 @@ namespace Microsoft.AspNetCore.Razor.Evolution
|
|||
Context.Writer.WriteStartNewObject("HelperResult" /* ORIGINAL: TemplateTypeName */);
|
||||
|
||||
var initialRenderingConventions = Context.RenderingConventions;
|
||||
var redirectConventions = new CSharpRedirectRenderingConventions(ValueWriterName, Context.Writer);
|
||||
Context.RenderingConventions = redirectConventions;
|
||||
Context.RenderingConventions = new CSharpRedirectRenderingConventions(ValueWriterName, Context.Writer);
|
||||
using (Context.Writer.BuildAsyncLambda(endLine: false, parameterNames: ValueWriterName))
|
||||
{
|
||||
VisitDefault(node);
|
||||
|
|
@ -250,8 +263,7 @@ namespace Microsoft.AspNetCore.Razor.Evolution
|
|||
.WriteStartNewObject("HelperResult" /* ORIGINAL: TemplateTypeName */);
|
||||
|
||||
var initialRenderingConventions = Context.RenderingConventions;
|
||||
var redirectConventions = new CSharpRedirectRenderingConventions(TemplateWriterName, Context.Writer);
|
||||
Context.RenderingConventions = redirectConventions;
|
||||
Context.RenderingConventions = new CSharpRedirectRenderingConventions(TemplateWriterName, Context.Writer);
|
||||
using (Context.Writer.BuildAsyncLambda(endLine: false, parameterNames: TemplateWriterName))
|
||||
{
|
||||
VisitDefault(node);
|
||||
|
|
@ -260,6 +272,375 @@ namespace Microsoft.AspNetCore.Razor.Evolution
|
|||
|
||||
Context.Writer.WriteEndMethodInvocation(endLine: false);
|
||||
}
|
||||
|
||||
internal override void VisitTagHelper(TagHelperIRNode node)
|
||||
{
|
||||
var initialTagHelperRenderingContext = Context.TagHelperRenderingContext;
|
||||
Context.TagHelperRenderingContext = new TagHelperRenderingContext();
|
||||
VisitDefault(node);
|
||||
Context.TagHelperRenderingContext = initialTagHelperRenderingContext;
|
||||
}
|
||||
|
||||
internal override void VisitInitializeTagHelperStructure(InitializeTagHelperStructureIRNode node)
|
||||
{
|
||||
// Call into the tag helper scope manager to start a new tag helper scope.
|
||||
// Also capture the value as the current execution context.
|
||||
Context.Writer
|
||||
.WriteStartAssignment("__tagHelperExecutionContext" /* ORIGINAL: ExecutionContextVariableName */)
|
||||
.WriteStartInstanceMethodInvocation(
|
||||
"__tagHelperScopeManager" /* ORIGINAL: ScopeManagerVariableName */,
|
||||
"Begin" /* ORIGINAL: ScopeManagerBeginMethodName */);
|
||||
|
||||
// Assign a unique ID for this instance of the source HTML tag. This must be unique
|
||||
// per call site, e.g. if the tag is on the view twice, there should be two IDs.
|
||||
Context.Writer.WriteStringLiteral(node.TagName)
|
||||
.WriteParameterSeparator()
|
||||
.Write("global::")
|
||||
.Write(typeof(TagMode).FullName)
|
||||
.Write(".")
|
||||
.Write(node.TagMode.ToString())
|
||||
.WriteParameterSeparator()
|
||||
.WriteStringLiteral(GenerateUniqueTagHelperId)
|
||||
.WriteParameterSeparator();
|
||||
|
||||
// We remove and redirect writers so TagHelper authors can retrieve content.
|
||||
var initialRenderingConventions = Context.RenderingConventions;
|
||||
Context.RenderingConventions = new CSharpRenderingConventions(Context.Writer);
|
||||
using (Context.Writer.BuildAsyncLambda(endLine: false))
|
||||
{
|
||||
VisitDefault(node);
|
||||
}
|
||||
Context.RenderingConventions = initialRenderingConventions;
|
||||
|
||||
Context.Writer.WriteEndMethodInvocation();
|
||||
}
|
||||
|
||||
internal override void VisitCreateTagHelper(CreateTagHelperIRNode node)
|
||||
{
|
||||
var tagHelperVariableName = GetTagHelperVariableName(node.TagHelperTypeName);
|
||||
|
||||
Context.Writer
|
||||
.WriteStartAssignment(tagHelperVariableName)
|
||||
.WriteStartMethodInvocation(
|
||||
"CreateTagHelper" /* ORIGINAL: CreateTagHelperMethodName */,
|
||||
"global::" + node.TagHelperTypeName)
|
||||
.WriteEndMethodInvocation();
|
||||
|
||||
Context.Writer.WriteInstanceMethodInvocation(
|
||||
"__tagHelperExecutionContext" /* ORIGINAL: ExecutionContextVariableName */,
|
||||
"Add" /* ORIGINAL: ExecutionContextAddMethodName */,
|
||||
tagHelperVariableName);
|
||||
}
|
||||
|
||||
internal override void VisitAddTagHelperHtmlAttribute(AddTagHelperHtmlAttributeIRNode node)
|
||||
{
|
||||
var attributeValueStyleParameter = $"global::{typeof(HtmlAttributeValueStyle).FullName}.{node.ValueStyle}";
|
||||
var isConditionalAttributeValue = node.Children.Any(child => child is CSharpAttributeValueIRNode);
|
||||
|
||||
// All simple text and minimized attributes will be pre-allocated.
|
||||
if (isConditionalAttributeValue)
|
||||
{
|
||||
// Dynamic attribute value should be run through the conditional attribute removal system. It's
|
||||
// unbound and contains C#.
|
||||
|
||||
// TagHelper attribute rendering is buffered by default. We do not want to write to the current
|
||||
// writer.
|
||||
var valuePieceCount = node.Children.Count(
|
||||
child => child is HtmlAttributeValueIRNode || child is CSharpAttributeValueIRNode);
|
||||
|
||||
Context.Writer
|
||||
.WriteStartMethodInvocation("BeginAddHtmlAttributeValues" /* ORIGINAL: BeginAddHtmlAttributeValuesMethodName */)
|
||||
.Write("__tagHelperExecutionContext" /* ORIGINAL: ExecutionContextVariableName */)
|
||||
.WriteParameterSeparator()
|
||||
.WriteStringLiteral(node.Name)
|
||||
.WriteParameterSeparator()
|
||||
.Write(valuePieceCount.ToString(CultureInfo.InvariantCulture))
|
||||
.WriteParameterSeparator()
|
||||
.Write(attributeValueStyleParameter)
|
||||
.WriteEndMethodInvocation();
|
||||
|
||||
var initialRenderingConventions = Context.RenderingConventions;
|
||||
Context.RenderingConventions = new TagHelperHtmlAttributeRenderingConventions(Context.Writer);
|
||||
VisitDefault(node);
|
||||
Context.RenderingConventions = initialRenderingConventions;
|
||||
|
||||
Context.Writer
|
||||
.WriteMethodInvocation(
|
||||
"EndAddHtmlAttributeValues" /* ORIGINAL: EndAddHtmlAttributeValuesMethodName */,
|
||||
"__tagHelperExecutionContext" /* ORIGINAL: ExecutionContextVariableName */);
|
||||
}
|
||||
else
|
||||
{
|
||||
// This is a data-* attribute which includes C#. Do not perform the conditional attribute removal or
|
||||
// other special cases used when IsDynamicAttributeValue(). But the attribute must still be buffered to
|
||||
// determine its final value.
|
||||
|
||||
// Attribute value is not plain text, must be buffered to determine its final value.
|
||||
Context.Writer.WriteMethodInvocation("BeginWriteTagHelperAttribute" /* ORIGINAL: BeginWriteTagHelperAttributeMethodName */);
|
||||
|
||||
// We're building a writing scope around the provided chunks which captures everything written from the
|
||||
// page. Therefore, we do not want to write to any other buffer since we're using the pages buffer to
|
||||
// ensure we capture all content that's written, directly or indirectly.
|
||||
var initialRenderingConventions = Context.RenderingConventions;
|
||||
Context.RenderingConventions = new CSharpRenderingConventions(Context.Writer);
|
||||
VisitDefault(node);
|
||||
Context.RenderingConventions = initialRenderingConventions;
|
||||
|
||||
Context.Writer
|
||||
.WriteStartAssignment("__tagHelperStringValueBuffer" /* ORIGINAL: StringValueBufferVariableName */)
|
||||
.WriteMethodInvocation("EndWriteTagHelperAttribute" /* ORIGINAL: EndWriteTagHelperAttributeMethodName */)
|
||||
.WriteStartInstanceMethodInvocation(
|
||||
"__tagHelperExecutionContext" /* ORIGINAL: ExecutionContextVariableName */,
|
||||
"AddHtmlAttribute" /* ORIGINAL: ExecutionContextAddHtmlAttributeMethodName */)
|
||||
.WriteStringLiteral(node.Name)
|
||||
.WriteParameterSeparator()
|
||||
.WriteStartMethodInvocation("Html.Raw" /* ORIGINAL: MarkAsHtmlEncodedMethodName */)
|
||||
.Write("__tagHelperStringValueBuffer" /* ORIGINAL: StringValueBufferVariableName */)
|
||||
.WriteEndMethodInvocation(endLine: false)
|
||||
.WriteParameterSeparator()
|
||||
.Write(attributeValueStyleParameter)
|
||||
.WriteEndMethodInvocation();
|
||||
}
|
||||
}
|
||||
|
||||
internal override void VisitSetTagHelperProperty(SetTagHelperPropertyIRNode node)
|
||||
{
|
||||
var tagHelperVariableName = GetTagHelperVariableName(node.TagHelperTypeName);
|
||||
var tagHelperRenderingContext = Context.TagHelperRenderingContext;
|
||||
|
||||
// Ensure that the property we're trying to set has initialized its dictionary bound properties.
|
||||
if (node.Descriptor.IsIndexer &&
|
||||
tagHelperRenderingContext.VerifiedPropertyDictionaries.Add(node.Descriptor.PropertyName))
|
||||
{
|
||||
// Throw a reasonable Exception at runtime if the dictionary property is null.
|
||||
Context.Writer
|
||||
.Write("if (")
|
||||
.Write(tagHelperVariableName)
|
||||
.Write(".")
|
||||
.Write(node.Descriptor.PropertyName)
|
||||
.WriteLine(" == null)");
|
||||
using (Context.Writer.BuildScope())
|
||||
{
|
||||
// System is in Host.NamespaceImports for all MVC scenarios. No need to generate FullName
|
||||
// of InvalidOperationException type.
|
||||
Context.Writer
|
||||
.Write("throw ")
|
||||
.WriteStartNewObject(nameof(InvalidOperationException))
|
||||
.WriteStartMethodInvocation("FormatInvalidIndexerAssignment" /* ORIGINAL: FormatInvalidIndexerAssignmentMethodName */)
|
||||
.WriteStringLiteral(node.AttributeName)
|
||||
.WriteParameterSeparator()
|
||||
.WriteStringLiteral(node.TagHelperTypeName)
|
||||
.WriteParameterSeparator()
|
||||
.WriteStringLiteral(node.Descriptor.PropertyName)
|
||||
.WriteEndMethodInvocation(endLine: false) // End of method call
|
||||
.WriteEndMethodInvocation(); // End of new expression / throw statement
|
||||
}
|
||||
}
|
||||
|
||||
var propertyValueAccessor = GetTagHelperPropertyAccessor(tagHelperVariableName, node.AttributeName, node.Descriptor);
|
||||
|
||||
string previousValueAccessor;
|
||||
if (tagHelperRenderingContext.RenderedBoundAttributes.TryGetValue(node.AttributeName, out previousValueAccessor))
|
||||
{
|
||||
Context.Writer
|
||||
.WriteStartAssignment(propertyValueAccessor)
|
||||
.Write(previousValueAccessor)
|
||||
.WriteLine(";");
|
||||
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
tagHelperRenderingContext.RenderedBoundAttributes[node.AttributeName] = propertyValueAccessor;
|
||||
}
|
||||
|
||||
if (node.Descriptor.IsStringProperty)
|
||||
{
|
||||
Context.Writer.WriteMethodInvocation("BeginWriteTagHelperAttribute" /* ORIGINAL: BeginWriteTagHelperAttributeMethodName */);
|
||||
|
||||
var initialRenderingConventions = Context.RenderingConventions;
|
||||
Context.RenderingConventions = new CSharpLiteralCodeConventions(Context.Writer);
|
||||
VisitDefault(node);
|
||||
Context.RenderingConventions = initialRenderingConventions;
|
||||
|
||||
Context.Writer
|
||||
.WriteStartAssignment("__tagHelperStringValueBuffer" /* ORIGINAL: StringValueBufferVariableName */)
|
||||
.WriteMethodInvocation("EndWriteTagHelperAttribute" /* ORIGINAL: EndWriteTagHelperAttributeMethodName */)
|
||||
.WriteStartAssignment(propertyValueAccessor)
|
||||
.Write("__tagHelperStringValueBuffer" /* ORIGINAL: StringValueBufferVariableName */)
|
||||
.WriteLine(";");
|
||||
}
|
||||
else
|
||||
{
|
||||
using (new LinePragmaWriter(Context.Writer, node.SourceRange))
|
||||
{
|
||||
Context.Writer.WriteStartAssignment(propertyValueAccessor);
|
||||
|
||||
if (node.Descriptor.IsEnum &&
|
||||
node.Children.Count == 1 &&
|
||||
node.Children.First() is HtmlContentIRNode)
|
||||
{
|
||||
Context.Writer
|
||||
.Write("global::")
|
||||
.Write(node.Descriptor.TypeName)
|
||||
.Write(".");
|
||||
}
|
||||
|
||||
RenderTagHelperAttributeInline(node, node.SourceRange, Context);
|
||||
|
||||
Context.Writer.WriteLine(";");
|
||||
}
|
||||
}
|
||||
|
||||
// We need to inform the context of the attribute value.
|
||||
Context.Writer
|
||||
.WriteStartInstanceMethodInvocation(
|
||||
"__tagHelperExecutionContext" /* ORIGINAL: ExecutionContextVariableName */,
|
||||
"AddTagHelperAttribute" /* ORIGINAL: ExecutionContextAddTagHelperAttributeMethodName */)
|
||||
.WriteStringLiteral(node.AttributeName)
|
||||
.WriteParameterSeparator()
|
||||
.Write(propertyValueAccessor)
|
||||
.WriteParameterSeparator()
|
||||
.Write($"global::{typeof(HtmlAttributeValueStyle).FullName}.{node.ValueStyle}")
|
||||
.WriteEndMethodInvocation();
|
||||
}
|
||||
|
||||
internal override void VisitExecuteTagHelpers(ExecuteTagHelpersIRNode node)
|
||||
{
|
||||
Context.Writer
|
||||
.Write("await ")
|
||||
.WriteStartInstanceMethodInvocation(
|
||||
"__tagHelperRunner" /* ORIGINAL: RunnerVariableName */,
|
||||
"RunAsync" /* ORIGINAL: RunnerRunAsyncMethodName */)
|
||||
.Write("__tagHelperExecutionContext" /* ORIGINAL: ExecutionContextVariableName */)
|
||||
.WriteEndMethodInvocation();
|
||||
|
||||
var executionContextVariableName = "__tagHelperExecutionContext" /* ORIGINAL: ExecutionContextVariableName */;
|
||||
var executionContextOutputPropertyName = "Output" /* ORIGINAL: ExecutionContextOutputPropertyName */;
|
||||
var tagHelperOutputAccessor = $"{executionContextVariableName}.{executionContextOutputPropertyName}";
|
||||
|
||||
Context.Writer
|
||||
.Write("if (!")
|
||||
.Write(tagHelperOutputAccessor)
|
||||
.Write(".")
|
||||
.Write("IsContentModified" /* ORIGINAL: TagHelperOutputIsContentModifiedPropertyName */)
|
||||
.WriteLine(")");
|
||||
|
||||
using (Context.Writer.BuildScope())
|
||||
{
|
||||
Context.Writer
|
||||
.Write("await ")
|
||||
.WriteInstanceMethodInvocation(
|
||||
executionContextVariableName,
|
||||
"SetOutputContentAsync" /* ORIGINAL: ExecutionContextSetOutputContentAsyncMethodName */);
|
||||
}
|
||||
|
||||
Context.Writer
|
||||
.Write(Context.RenderingConventions.StartWriteMethod)
|
||||
.Write(tagHelperOutputAccessor)
|
||||
.WriteEndMethodInvocation()
|
||||
.WriteStartAssignment(executionContextVariableName)
|
||||
.WriteInstanceMethodInvocation(
|
||||
"__tagHelperScopeManager" /* ORIGINAL: ScopeManagerVariableName */,
|
||||
"End" /* ORIGINAL: ScopeManagerEndMethodName */);
|
||||
}
|
||||
|
||||
internal override void VisitDeclareTagHelperFields(DeclareTagHelperFieldsIRNode node)
|
||||
{
|
||||
Context.Writer.WriteLineHiddenDirective();
|
||||
|
||||
// Need to disable the warning "X is assigned to but never used." for the value buffer since
|
||||
// whether it's used depends on how a TagHelper is used.
|
||||
Context.Writer
|
||||
.WritePragma("warning disable 0414")
|
||||
.Write("private ")
|
||||
.WriteVariableDeclaration("string", "__tagHelperStringValueBuffer" /* ORIGINAL: StringValueBufferVariableName */, value: null)
|
||||
.WritePragma("warning restore 0414");
|
||||
|
||||
Context.Writer
|
||||
.Write("private global::")
|
||||
.WriteVariableDeclaration(
|
||||
"Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext" /* ORIGINAL: ExecutionContextTypeName */,
|
||||
"__tagHelperExecutionContext" /* ORIGINAL: ExecutionContextVariableName */,
|
||||
value: null);
|
||||
|
||||
Context.Writer
|
||||
.Write("private global::")
|
||||
.Write("Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner" /* ORIGINAL: RunnerTypeName */)
|
||||
.Write(" ")
|
||||
.Write("__tagHelperRunner" /* ORIGINAL: RunnerVariableName */)
|
||||
.Write(" = new global::")
|
||||
.Write("Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner" /* ORIGINAL: RunnerTypeName */)
|
||||
.WriteLine("();");
|
||||
|
||||
const string backedScopeManageVariableName = "__backed" + "__tagHelperScopeManager" /* ORIGINAL: ScopeManagerVariableName */;
|
||||
Context.Writer
|
||||
.Write("private global::")
|
||||
.WriteVariableDeclaration(
|
||||
"Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager",
|
||||
backedScopeManageVariableName,
|
||||
value: null);
|
||||
|
||||
Context.Writer
|
||||
.Write("private global::")
|
||||
.Write("Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager" /* ORIGINAL: ScopeManagerTypeName */)
|
||||
.Write(" ")
|
||||
.WriteLine("__tagHelperScopeManager" /* ORIGINAL: ScopeManagerVariableName */);
|
||||
|
||||
using (Context.Writer.BuildScope())
|
||||
{
|
||||
Context.Writer.WriteLine("get");
|
||||
using (Context.Writer.BuildScope())
|
||||
{
|
||||
Context.Writer
|
||||
.Write("if (")
|
||||
.Write(backedScopeManageVariableName)
|
||||
.WriteLine(" == null)");
|
||||
|
||||
using (Context.Writer.BuildScope())
|
||||
{
|
||||
Context.Writer
|
||||
.WriteStartAssignment(backedScopeManageVariableName)
|
||||
.WriteStartNewObject("Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager" /* ORIGINAL: ScopeManagerTypeName */)
|
||||
.Write("StartTagHelperWritingScope" /* ORIGINAL: StartTagHelperWritingScopeMethodName */)
|
||||
.WriteParameterSeparator()
|
||||
.Write("EndTagHelperWritingScope" /* ORIGINAL: EndTagHelperWritingScopeMethodName */)
|
||||
.WriteEndMethodInvocation();
|
||||
}
|
||||
|
||||
Context.Writer.WriteReturn(backedScopeManageVariableName);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var tagHelperTypeName in node.UsedTagHelperTypeNames)
|
||||
{
|
||||
var tagHelperVariableName = GetTagHelperVariableName(tagHelperTypeName);
|
||||
Context.Writer
|
||||
.Write("private global::")
|
||||
.WriteVariableDeclaration(
|
||||
tagHelperTypeName,
|
||||
tagHelperVariableName,
|
||||
value: null);
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetTagHelperPropertyAccessor(
|
||||
string tagHelperVariableName,
|
||||
string attributeName,
|
||||
TagHelperAttributeDescriptor descriptor)
|
||||
{
|
||||
var propertyAccessor = $"{tagHelperVariableName}.{descriptor.PropertyName}";
|
||||
|
||||
if (descriptor.IsIndexer)
|
||||
{
|
||||
var dictionaryKey = attributeName.Substring(descriptor.Name.Length);
|
||||
propertyAccessor += $"[\"{dictionaryKey}\"]";
|
||||
}
|
||||
|
||||
return propertyAccessor;
|
||||
}
|
||||
|
||||
private static string GetTagHelperVariableName(string tagHelperTypeName) => "__" + tagHelperTypeName.Replace('.', '_');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -384,6 +384,14 @@ Instead, wrap the contents of the block in "{{}}":
|
|||
<data name="TagHelpers_CannotHaveCSharpInTagDeclaration" xml:space="preserve">
|
||||
<value>The tag helper '{0}' must not have C# in the element's attribute declaration area.</value>
|
||||
</data>
|
||||
<data name="TagHelpers_CodeBlocks_NotSupported_InAttributes" xml:space="preserve">
|
||||
<value>Code blocks (e.g. @{{var variable = 23;}}) must not appear in non-string tag helper attribute values.
|
||||
Already in an expression (code) context. If necessary an explicit expression (e.g. @(@readonly)) may be used.</value>
|
||||
</data>
|
||||
<data name="TagHelpers_InlineMarkupBlocks_NotSupported_InAttributes" xml:space="preserve">
|
||||
<value>Inline markup blocks (e.g. @<p>content</p>) must not appear in non-string tag helper attribute values.
|
||||
Expected a '{0}' attribute value, not a string.</value>
|
||||
</data>
|
||||
<data name="TokenizerView_CannotPutBack" xml:space="preserve">
|
||||
<value>In order to put a symbol back, it must have been the symbol which ended at the current position. The specified symbol ends at {0}, but the current position is {1}</value>
|
||||
</data>
|
||||
|
|
|
|||
|
|
@ -1334,6 +1334,42 @@ namespace Microsoft.AspNetCore.Razor.Evolution
|
|||
return string.Format(CultureInfo.CurrentCulture, GetString("TagHelpers_CannotHaveCSharpInTagDeclaration"), p0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Code blocks (e.g. @{{var variable = 23;}}) must not appear in non-string tag helper attribute values.
|
||||
/// Already in an expression (code) context. If necessary an explicit expression (e.g. @(@readonly)) may be used.
|
||||
/// </summary>
|
||||
internal static string TagHelpers_CodeBlocks_NotSupported_InAttributes
|
||||
{
|
||||
get { return GetString("TagHelpers_CodeBlocks_NotSupported_InAttributes"); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Code blocks (e.g. @{{var variable = 23;}}) must not appear in non-string tag helper attribute values.
|
||||
/// Already in an expression (code) context. If necessary an explicit expression (e.g. @(@readonly)) may be used.
|
||||
/// </summary>
|
||||
internal static string FormatTagHelpers_CodeBlocks_NotSupported_InAttributes()
|
||||
{
|
||||
return GetString("TagHelpers_CodeBlocks_NotSupported_InAttributes");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Inline markup blocks (e.g. @<p>content</p>) must not appear in non-string tag helper attribute values.
|
||||
/// Expected a '{0}' attribute value, not a string.
|
||||
/// </summary>
|
||||
internal static string TagHelpers_InlineMarkupBlocks_NotSupported_InAttributes
|
||||
{
|
||||
get { return GetString("TagHelpers_InlineMarkupBlocks_NotSupported_InAttributes"); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Inline markup blocks (e.g. @<p>content</p>) must not appear in non-string tag helper attribute values.
|
||||
/// Expected a '{0}' attribute value, not a string.
|
||||
/// </summary>
|
||||
internal static string FormatTagHelpers_InlineMarkupBlocks_NotSupported_InAttributes(object p0)
|
||||
{
|
||||
return string.Format(CultureInfo.CurrentCulture, GetString("TagHelpers_InlineMarkupBlocks_NotSupported_InAttributes"), p0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// In order to put a symbol back, it must have been the symbol which ended at the current position. The specified symbol ends at {0}, but the current position is {1}
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -11,5 +11,7 @@ namespace Microsoft.AspNetCore.Razor.Evolution
|
|||
public string GeneratedCode { get; set; }
|
||||
|
||||
internal IReadOnlyList<LineMapping> LineMappings { get; set; }
|
||||
|
||||
internal IReadOnlyList<RazorError> Diagnostics { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,43 @@ namespace Microsoft.AspNetCore.Razor.Evolution
|
|||
}
|
||||
}
|
||||
|
||||
protected static void RenderTagHelperAttributeInline(
|
||||
RazorIRNode node,
|
||||
MappingLocation documentLocation,
|
||||
CSharpRenderingContext context)
|
||||
{
|
||||
if (node is SetTagHelperPropertyIRNode || node is CSharpExpressionIRNode)
|
||||
{
|
||||
for (var i = 0; i < node.Children.Count; i++)
|
||||
{
|
||||
RenderTagHelperAttributeInline(node.Children[i], documentLocation, context);
|
||||
}
|
||||
}
|
||||
else if (node is HtmlContentIRNode)
|
||||
{
|
||||
context.Writer.Write(((HtmlContentIRNode)node).Content);
|
||||
}
|
||||
else if (node is CSharpTokenIRNode)
|
||||
{
|
||||
context.Writer.Write(((CSharpTokenIRNode)node).Content);
|
||||
}
|
||||
else if (node is CSharpStatementIRNode)
|
||||
{
|
||||
context.ErrorSink.OnError(
|
||||
new SourceLocation(documentLocation.AbsoluteIndex, documentLocation.CharacterIndex, documentLocation.ContentLength),
|
||||
LegacyResources.TagHelpers_CodeBlocks_NotSupported_InAttributes,
|
||||
documentLocation.ContentLength);
|
||||
}
|
||||
else if (node is TemplateIRNode)
|
||||
{
|
||||
var attributeValueNode = (SetTagHelperPropertyIRNode)node.Parent;
|
||||
context.ErrorSink.OnError(
|
||||
new SourceLocation(documentLocation.AbsoluteIndex, documentLocation.CharacterIndex, documentLocation.ContentLength),
|
||||
LegacyResources.FormatTagHelpers_InlineMarkupBlocks_NotSupported_InAttributes(attributeValueNode.Descriptor.TypeName),
|
||||
documentLocation.ContentLength);
|
||||
}
|
||||
}
|
||||
|
||||
protected static int CalculateExpressionPadding(MappingLocation sourceRange, CSharpRenderingContext context)
|
||||
{
|
||||
var spaceCount = 0;
|
||||
|
|
@ -120,13 +157,10 @@ namespace Microsoft.AspNetCore.Razor.Evolution
|
|||
|
||||
public override string StartWriteLiteralMethod => "WriteLiteralTo(" + _redirectWriter + ", " /* ORIGINAL: WriteLiteralToMethodName */;
|
||||
|
||||
|
||||
public override string StartBeginWriteAttributeMethod => "BeginWriteAttributeTo(" + _redirectWriter + ", " /* ORIGINAL: BeginWriteAttributeToMethodName */;
|
||||
|
||||
|
||||
public override string StartWriteAttributeValueMethod => "WriteAttributeValueTo(" + _redirectWriter + ", " /* ORIGINAL: WriteAttributeValueToMethodName */;
|
||||
|
||||
|
||||
public override string StartEndWriteAttributeMethod => "EndWriteAttributeTo(" + _redirectWriter /* ORIGINAL: EndWriteAttributeToMethodName */;
|
||||
}
|
||||
|
||||
|
|
@ -150,6 +184,24 @@ namespace Microsoft.AspNetCore.Razor.Evolution
|
|||
public virtual string StartEndWriteAttributeMethod => "EndWriteAttribute(" /* ORIGINAL: EndWriteAttributeMethodName */;
|
||||
}
|
||||
|
||||
protected class TagHelperHtmlAttributeRenderingConventions : CSharpRenderingConventions
|
||||
{
|
||||
public TagHelperHtmlAttributeRenderingConventions(CSharpCodeWriter writer) : base(writer)
|
||||
{
|
||||
}
|
||||
|
||||
public override string StartWriteAttributeValueMethod => "AddHtmlAttributeValue(" /* ORIGINAL: AddHtmlAttributeValueMethodName */;
|
||||
}
|
||||
|
||||
protected class CSharpLiteralCodeConventions : CSharpRenderingConventions
|
||||
{
|
||||
public CSharpLiteralCodeConventions(CSharpCodeWriter writer) : base(writer)
|
||||
{
|
||||
}
|
||||
|
||||
public override string StartWriteMethod => StartWriteLiteralMethod;
|
||||
}
|
||||
|
||||
protected class CSharpRenderingContext
|
||||
{
|
||||
private CSharpRenderingConventions _renderingConventions;
|
||||
|
|
@ -177,11 +229,45 @@ namespace Microsoft.AspNetCore.Razor.Evolution
|
|||
}
|
||||
}
|
||||
|
||||
public ICollection<RazorError> Errors { get; } = new List<RazorError>();
|
||||
public ErrorSink ErrorSink { get; } = new ErrorSink();
|
||||
|
||||
public RazorSourceDocument SourceDocument { get; set; }
|
||||
|
||||
public RazorParserOptions Options { get; set; }
|
||||
|
||||
public TagHelperRenderingContext TagHelperRenderingContext { get; set; }
|
||||
}
|
||||
|
||||
protected class TagHelperRenderingContext
|
||||
{
|
||||
private Dictionary<string, string> _renderedBoundAttributes;
|
||||
private HashSet<string> _verifiedPropertyDictionaries;
|
||||
|
||||
public Dictionary<string, string> RenderedBoundAttributes
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_renderedBoundAttributes == null)
|
||||
{
|
||||
_renderedBoundAttributes = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
return _renderedBoundAttributes;
|
||||
}
|
||||
}
|
||||
|
||||
public HashSet<string> VerifiedPropertyDictionaries
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_verifiedPropertyDictionaries == null)
|
||||
{
|
||||
_verifiedPropertyDictionaries = new HashSet<string>(StringComparer.Ordinal);
|
||||
}
|
||||
|
||||
return _verifiedPropertyDictionaries;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected class PageStructureCSharpRenderer : RazorIRNodeWalker
|
||||
|
|
|
|||
|
|
@ -2,9 +2,11 @@
|
|||
// 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.IO;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Razor.Evolution.Intermediate;
|
||||
using Microsoft.AspNetCore.Razor.Evolution.Legacy;
|
||||
using Xunit;
|
||||
using Xunit.Sdk;
|
||||
|
||||
|
|
@ -544,6 +546,154 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests
|
|||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SimpleTagHelpers_Runtime()
|
||||
{
|
||||
// Arrange, Act & Assert
|
||||
RunTagHelpersTest(TestTagHelperDescriptors.SimpleTagHelperDescriptors);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TagHelpersWithBoundAttributes_Runtime()
|
||||
{
|
||||
// Arrange, Act & Assert
|
||||
RunTagHelpersTest(TestTagHelperDescriptors.SimpleTagHelperDescriptors);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NestedTagHelpers_Runtime()
|
||||
{
|
||||
|
||||
// Arrange, Act & Assert
|
||||
RunTagHelpersTest(TestTagHelperDescriptors.SimpleTagHelperDescriptors);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SingleTagHelper_Runtime()
|
||||
{
|
||||
// Arrange, Act & Assert
|
||||
RunTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SingleTagHelperWithNewlineBeforeAttributes_Runtime()
|
||||
{
|
||||
// Arrange, Act & Assert
|
||||
RunTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TagHelpersWithWeirdlySpacedAttributes_Runtime()
|
||||
{
|
||||
// Arrange, Act & Assert
|
||||
RunTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void IncompleteTagHelper_Runtime()
|
||||
{
|
||||
// Arrange, Act & Assert
|
||||
RunTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void BasicTagHelpers_Runtime()
|
||||
{
|
||||
// Arrange, Act & Assert
|
||||
RunTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void BasicTagHelpers_Prefixed_Runtime()
|
||||
{
|
||||
// Arrange, Act & Assert
|
||||
RunTagHelpersTest(TestTagHelperDescriptors.PrefixedPAndInputTagHelperDescriptors);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ComplexTagHelpers_Runtime()
|
||||
{
|
||||
// Arrange, Act & Assert
|
||||
RunTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DuplicateTargetTagHelper_Runtime()
|
||||
{
|
||||
// Arrange, Act & Assert
|
||||
RunTagHelpersTest(TestTagHelperDescriptors.DuplicateTargetTagHelperDescriptors);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void EmptyAttributeTagHelpers_Runtime()
|
||||
{
|
||||
// Arrange, Act & Assert
|
||||
RunTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void EscapedTagHelpers_Runtime()
|
||||
{
|
||||
// Arrange, Act & Assert
|
||||
RunTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AttributeTargetingTagHelpers_Runtime()
|
||||
{
|
||||
// Arrange, Act & Assert
|
||||
RunTagHelpersTest(TestTagHelperDescriptors.AttributeTargetingTagHelperDescriptors);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PrefixedAttributeTagHelpers_Runtime()
|
||||
{
|
||||
// Arrange, Act & Assert
|
||||
RunTagHelpersTest(TestTagHelperDescriptors.PrefixedAttributeTagHelperDescriptors);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DuplicateAttributeTagHelpers_Runtime()
|
||||
{
|
||||
// Arrange, Act & Assert
|
||||
RunTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DynamicAttributeTagHelpers_Runtime()
|
||||
{
|
||||
// Arrange, Act & Assert
|
||||
RunTagHelpersTest(TestTagHelperDescriptors.DynamicAttributeTagHelpers_Descriptors);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TransitionsInTagHelperAttributes_Runtime()
|
||||
{
|
||||
// Arrange, Act & Assert
|
||||
RunTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NestedScriptTagTagHelpers_Runtime()
|
||||
{
|
||||
// Arrange, Act & Assert
|
||||
RunTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SymbolBoundAttributes_Runtime()
|
||||
{
|
||||
// Arrange, Act & Assert
|
||||
RunTagHelpersTest(TestTagHelperDescriptors.SymbolBoundTagHelperDescriptors);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void EnumTagHelpers_Runtime()
|
||||
{
|
||||
// Arrange, Act & Assert
|
||||
RunTagHelpersTest(TestTagHelperDescriptors.EnumTagHelperDescriptors);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region DesignTime
|
||||
|
|
@ -1113,6 +1263,40 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests
|
|||
return RazorCodeDocument.Create(TestRazorSourceDocument.CreateResource(sourceFilename));
|
||||
}
|
||||
|
||||
private void RunTagHelpersTest(IEnumerable<TagHelperDescriptor> descriptors)
|
||||
{
|
||||
// Arrange
|
||||
var engine = RazorEngine.Create(
|
||||
builder =>
|
||||
{
|
||||
builder.Features.Add(new ApiSetsIRTestAdapter());
|
||||
builder.Features.Add(new TagHelperFeature(new TestTagHelperDescriptorResolver(descriptors)));
|
||||
DefaultRazorRuntimeCSharpLoweringPhase.GenerateUniqueTagHelperId = "test";
|
||||
});
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
private class TestTagHelperDescriptorResolver : ITagHelperDescriptorResolver
|
||||
{
|
||||
private readonly IEnumerable<TagHelperDescriptor> _descriptors;
|
||||
|
||||
public TestTagHelperDescriptorResolver(IEnumerable<TagHelperDescriptor> descriptors)
|
||||
{
|
||||
_descriptors = descriptors;
|
||||
}
|
||||
|
||||
public IEnumerable<TagHelperDescriptor> Resolve(TagHelperDescriptorResolutionContext resolutionContext)
|
||||
{
|
||||
return _descriptors;
|
||||
}
|
||||
}
|
||||
|
||||
private class ApiSetsIRTestAdapter : RazorIRPassBase
|
||||
{
|
||||
public override DocumentIRNode ExecuteCore(DocumentIRNode irDocument)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,623 @@
|
|||
// 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.Reflection;
|
||||
using Microsoft.AspNetCore.Razor.Evolution.Legacy;
|
||||
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests
|
||||
{
|
||||
public class TestTagHelperDescriptors
|
||||
{
|
||||
internal static IEnumerable<TagHelperDescriptor> DefaultPAndInputTagHelperDescriptors { get; }
|
||||
= BuildPAndInputTagHelperDescriptors(prefix: string.Empty);
|
||||
internal static IEnumerable<TagHelperDescriptor> PrefixedPAndInputTagHelperDescriptors { get; }
|
||||
= BuildPAndInputTagHelperDescriptors(prefix: "THS");
|
||||
|
||||
internal static IEnumerable<TagHelperDescriptor> SimpleTagHelperDescriptors
|
||||
{
|
||||
get
|
||||
{
|
||||
return new[]
|
||||
{
|
||||
new TagHelperDescriptor
|
||||
{
|
||||
TagName = "span",
|
||||
TypeName = "SpanTagHelper"
|
||||
},
|
||||
new TagHelperDescriptor
|
||||
{
|
||||
TagName = "div",
|
||||
TypeName = "DivTagHelper"
|
||||
},
|
||||
new TagHelperDescriptor
|
||||
{
|
||||
TagName = "input",
|
||||
TypeName = "InputTagHelper",
|
||||
Attributes = new[] { new TagHelperAttributeDescriptor
|
||||
{
|
||||
Name = "value",
|
||||
PropertyName = "FooProp",
|
||||
TypeName = "System.String"
|
||||
} }
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
internal static IEnumerable<TagHelperDescriptor> CssSelectorTagHelperDescriptors
|
||||
{
|
||||
get
|
||||
{
|
||||
var inputTypePropertyInfo = typeof(TestType).GetProperty("Type");
|
||||
var inputCheckedPropertyInfo = typeof(TestType).GetProperty("Checked");
|
||||
|
||||
return new[]
|
||||
{
|
||||
new TagHelperDescriptor
|
||||
{
|
||||
TagName = "a",
|
||||
TypeName = "TestNamespace.ATagHelper",
|
||||
AssemblyName = "SomeAssembly",
|
||||
RequiredAttributes = new[]
|
||||
{
|
||||
new TagHelperRequiredAttributeDescriptor
|
||||
{
|
||||
Name = "href",
|
||||
NameComparison = TagHelperRequiredAttributeNameComparison.FullMatch,
|
||||
Value = "~/",
|
||||
ValueComparison = TagHelperRequiredAttributeValueComparison.FullMatch,
|
||||
}
|
||||
},
|
||||
},
|
||||
new TagHelperDescriptor
|
||||
{
|
||||
TagName = "a",
|
||||
TypeName = "TestNamespace.ATagHelperMultipleSelectors",
|
||||
AssemblyName = "SomeAssembly",
|
||||
RequiredAttributes = new[]
|
||||
{
|
||||
new TagHelperRequiredAttributeDescriptor
|
||||
{
|
||||
Name = "href",
|
||||
NameComparison = TagHelperRequiredAttributeNameComparison.FullMatch,
|
||||
Value = "~/",
|
||||
ValueComparison = TagHelperRequiredAttributeValueComparison.PrefixMatch,
|
||||
},
|
||||
new TagHelperRequiredAttributeDescriptor
|
||||
{
|
||||
Name = "href",
|
||||
NameComparison = TagHelperRequiredAttributeNameComparison.FullMatch,
|
||||
Value = "?hello=world",
|
||||
ValueComparison = TagHelperRequiredAttributeValueComparison.SuffixMatch,
|
||||
}
|
||||
},
|
||||
},
|
||||
new TagHelperDescriptor
|
||||
{
|
||||
TagName = "input",
|
||||
TypeName = "TestNamespace.InputTagHelper",
|
||||
AssemblyName = "SomeAssembly",
|
||||
Attributes = new TagHelperAttributeDescriptor[]
|
||||
{
|
||||
new TagHelperAttributeDescriptor("type", inputTypePropertyInfo),
|
||||
},
|
||||
RequiredAttributes = new[]
|
||||
{
|
||||
new TagHelperRequiredAttributeDescriptor
|
||||
{
|
||||
Name = "type",
|
||||
NameComparison = TagHelperRequiredAttributeNameComparison.FullMatch,
|
||||
Value = "text",
|
||||
ValueComparison = TagHelperRequiredAttributeValueComparison.FullMatch,
|
||||
}
|
||||
},
|
||||
},
|
||||
new TagHelperDescriptor
|
||||
{
|
||||
TagName = "input",
|
||||
TypeName = "TestNamespace.InputTagHelper2",
|
||||
AssemblyName = "SomeAssembly",
|
||||
Attributes = new TagHelperAttributeDescriptor[]
|
||||
{
|
||||
new TagHelperAttributeDescriptor("type", inputTypePropertyInfo),
|
||||
},
|
||||
RequiredAttributes = new[]
|
||||
{
|
||||
new TagHelperRequiredAttributeDescriptor
|
||||
{
|
||||
Name = "ty",
|
||||
NameComparison = TagHelperRequiredAttributeNameComparison.PrefixMatch,
|
||||
}
|
||||
},
|
||||
},
|
||||
new TagHelperDescriptor
|
||||
{
|
||||
TagName = "*",
|
||||
TypeName = "TestNamespace.CatchAllTagHelper",
|
||||
AssemblyName = "SomeAssembly",
|
||||
RequiredAttributes = new[]
|
||||
{
|
||||
new TagHelperRequiredAttributeDescriptor
|
||||
{
|
||||
Name = "href",
|
||||
NameComparison = TagHelperRequiredAttributeNameComparison.FullMatch,
|
||||
Value = "~/",
|
||||
ValueComparison = TagHelperRequiredAttributeValueComparison.PrefixMatch,
|
||||
}
|
||||
},
|
||||
},
|
||||
new TagHelperDescriptor
|
||||
{
|
||||
TagName = "*",
|
||||
TypeName = "TestNamespace.CatchAllTagHelper2",
|
||||
AssemblyName = "SomeAssembly",
|
||||
RequiredAttributes = new[]
|
||||
{
|
||||
new TagHelperRequiredAttributeDescriptor
|
||||
{
|
||||
Name = "type",
|
||||
NameComparison = TagHelperRequiredAttributeNameComparison.FullMatch,
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
internal static IEnumerable<TagHelperDescriptor> EnumTagHelperDescriptors
|
||||
{
|
||||
get
|
||||
{
|
||||
return new[]
|
||||
{
|
||||
new TagHelperDescriptor
|
||||
{
|
||||
TagName = "*",
|
||||
TypeName = "TestNamespace.CatchAllTagHelper",
|
||||
AssemblyName = "SomeAssembly",
|
||||
Attributes = new[]
|
||||
{
|
||||
new TagHelperAttributeDescriptor
|
||||
{
|
||||
Name = "catch-all",
|
||||
PropertyName = "CatchAll",
|
||||
IsEnum = true,
|
||||
TypeName = typeof(MyEnum).FullName
|
||||
},
|
||||
}
|
||||
},
|
||||
new TagHelperDescriptor
|
||||
{
|
||||
TagName = "input",
|
||||
TypeName = "TestNamespace.InputTagHelper",
|
||||
AssemblyName = "SomeAssembly",
|
||||
Attributes = new[]
|
||||
{
|
||||
new TagHelperAttributeDescriptor
|
||||
{
|
||||
Name = "value",
|
||||
PropertyName = "Value",
|
||||
IsEnum = true,
|
||||
TypeName = typeof(MyEnum).FullName
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
internal static IEnumerable<TagHelperDescriptor> SymbolBoundTagHelperDescriptors
|
||||
{
|
||||
get
|
||||
{
|
||||
return new[]
|
||||
{
|
||||
new TagHelperDescriptor
|
||||
{
|
||||
TagName = "*",
|
||||
TypeName = "TestNamespace.CatchAllTagHelper",
|
||||
AssemblyName = "SomeAssembly",
|
||||
Attributes = new[]
|
||||
{
|
||||
new TagHelperAttributeDescriptor
|
||||
{
|
||||
Name = "[item]",
|
||||
PropertyName = "ListItems",
|
||||
TypeName = typeof(List<string>).FullName
|
||||
},
|
||||
new TagHelperAttributeDescriptor
|
||||
{
|
||||
Name = "[(item)]",
|
||||
PropertyName = "ArrayItems",
|
||||
TypeName = typeof(string[]).FullName
|
||||
},
|
||||
new TagHelperAttributeDescriptor
|
||||
{
|
||||
Name = "(click)",
|
||||
PropertyName = "Event1",
|
||||
TypeName = typeof(Action).FullName
|
||||
},
|
||||
new TagHelperAttributeDescriptor
|
||||
{
|
||||
Name = "(^click)",
|
||||
PropertyName = "Event2",
|
||||
TypeName = typeof(Action).FullName
|
||||
},
|
||||
new TagHelperAttributeDescriptor
|
||||
{
|
||||
Name = "*something",
|
||||
PropertyName = "StringProperty1",
|
||||
TypeName = typeof(string).FullName
|
||||
},
|
||||
new TagHelperAttributeDescriptor
|
||||
{
|
||||
Name = "#local",
|
||||
PropertyName = "StringProperty2",
|
||||
TypeName = typeof(string).FullName
|
||||
},
|
||||
},
|
||||
RequiredAttributes = new[] { new TagHelperRequiredAttributeDescriptor { Name = "bound" } },
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
internal static IEnumerable<TagHelperDescriptor> MinimizedTagHelpers_Descriptors
|
||||
{
|
||||
get
|
||||
{
|
||||
return new[]
|
||||
{
|
||||
new TagHelperDescriptor
|
||||
{
|
||||
TagName = "*",
|
||||
TypeName = "TestNamespace.CatchAllTagHelper",
|
||||
AssemblyName = "SomeAssembly",
|
||||
Attributes = new[]
|
||||
{
|
||||
new TagHelperAttributeDescriptor
|
||||
{
|
||||
Name = "catchall-bound-string",
|
||||
PropertyName = "BoundRequiredString",
|
||||
TypeName = typeof(string).FullName,
|
||||
IsStringProperty = true
|
||||
}
|
||||
},
|
||||
RequiredAttributes = new[]
|
||||
{
|
||||
new TagHelperRequiredAttributeDescriptor { Name = "catchall-unbound-required" }
|
||||
},
|
||||
},
|
||||
new TagHelperDescriptor
|
||||
{
|
||||
TagName = "input",
|
||||
TypeName = "TestNamespace.InputTagHelper",
|
||||
AssemblyName = "SomeAssembly",
|
||||
Attributes = new[]
|
||||
{
|
||||
new TagHelperAttributeDescriptor
|
||||
{
|
||||
Name = "input-bound-required-string",
|
||||
PropertyName = "BoundRequiredString",
|
||||
TypeName = typeof(string).FullName,
|
||||
IsStringProperty = true
|
||||
},
|
||||
new TagHelperAttributeDescriptor
|
||||
{
|
||||
Name = "input-bound-string",
|
||||
PropertyName = "BoundString",
|
||||
TypeName = typeof(string).FullName,
|
||||
IsStringProperty = true
|
||||
}
|
||||
},
|
||||
RequiredAttributes = new[]
|
||||
{
|
||||
new TagHelperRequiredAttributeDescriptor { Name = "input-bound-required-string" },
|
||||
new TagHelperRequiredAttributeDescriptor { Name = "input-unbound-required" }
|
||||
},
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
internal static IEnumerable<TagHelperDescriptor> DynamicAttributeTagHelpers_Descriptors
|
||||
{
|
||||
get
|
||||
{
|
||||
return new[]
|
||||
{
|
||||
new TagHelperDescriptor
|
||||
{
|
||||
TagName = "input",
|
||||
TypeName = "TestNamespace.InputTagHelper",
|
||||
AssemblyName = "SomeAssembly",
|
||||
Attributes = new[]
|
||||
{
|
||||
new TagHelperAttributeDescriptor
|
||||
{
|
||||
Name = "bound",
|
||||
PropertyName = "Bound",
|
||||
TypeName = typeof(string).FullName,
|
||||
IsStringProperty = true
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
internal static IEnumerable<TagHelperDescriptor> DuplicateTargetTagHelperDescriptors
|
||||
{
|
||||
get
|
||||
{
|
||||
var inputTypePropertyInfo = typeof(TestType).GetProperty("Type");
|
||||
var inputCheckedPropertyInfo = typeof(TestType).GetProperty("Checked");
|
||||
return new[]
|
||||
{
|
||||
new TagHelperDescriptor
|
||||
{
|
||||
TagName = "*",
|
||||
TypeName = "TestNamespace.CatchAllTagHelper",
|
||||
AssemblyName = "SomeAssembly",
|
||||
Attributes = new TagHelperAttributeDescriptor[]
|
||||
{
|
||||
new TagHelperAttributeDescriptor("type", inputTypePropertyInfo),
|
||||
new TagHelperAttributeDescriptor("checked", inputCheckedPropertyInfo)
|
||||
},
|
||||
RequiredAttributes = new[] { new TagHelperRequiredAttributeDescriptor { Name = "type" } },
|
||||
},
|
||||
new TagHelperDescriptor
|
||||
{
|
||||
TagName = "*",
|
||||
TypeName = "TestNamespace.CatchAllTagHelper",
|
||||
AssemblyName = "SomeAssembly",
|
||||
Attributes = new TagHelperAttributeDescriptor[]
|
||||
{
|
||||
new TagHelperAttributeDescriptor("type", inputTypePropertyInfo),
|
||||
new TagHelperAttributeDescriptor("checked", inputCheckedPropertyInfo)
|
||||
},
|
||||
RequiredAttributes = new[] { new TagHelperRequiredAttributeDescriptor { Name = "checked" } },
|
||||
},
|
||||
new TagHelperDescriptor
|
||||
{
|
||||
TagName = "input",
|
||||
TypeName = "TestNamespace.InputTagHelper",
|
||||
AssemblyName = "SomeAssembly",
|
||||
Attributes = new TagHelperAttributeDescriptor[]
|
||||
{
|
||||
new TagHelperAttributeDescriptor("type", inputTypePropertyInfo),
|
||||
new TagHelperAttributeDescriptor("checked", inputCheckedPropertyInfo)
|
||||
},
|
||||
RequiredAttributes = new[] { new TagHelperRequiredAttributeDescriptor { Name = "type" } },
|
||||
},
|
||||
new TagHelperDescriptor
|
||||
{
|
||||
TagName = "input",
|
||||
TypeName = "TestNamespace.InputTagHelper",
|
||||
AssemblyName = "SomeAssembly",
|
||||
Attributes = new TagHelperAttributeDescriptor[]
|
||||
{
|
||||
new TagHelperAttributeDescriptor("type", inputTypePropertyInfo),
|
||||
new TagHelperAttributeDescriptor("checked", inputCheckedPropertyInfo)
|
||||
},
|
||||
RequiredAttributes = new[] { new TagHelperRequiredAttributeDescriptor { Name = "checked" } },
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
internal static IEnumerable<TagHelperDescriptor> AttributeTargetingTagHelperDescriptors
|
||||
{
|
||||
get
|
||||
{
|
||||
var inputTypePropertyInfo = typeof(TestType).GetProperty("Type");
|
||||
var inputCheckedPropertyInfo = typeof(TestType).GetProperty("Checked");
|
||||
return new[]
|
||||
{
|
||||
new TagHelperDescriptor
|
||||
{
|
||||
TagName = "p",
|
||||
TypeName = "TestNamespace.PTagHelper",
|
||||
AssemblyName = "SomeAssembly",
|
||||
RequiredAttributes = new[] { new TagHelperRequiredAttributeDescriptor { Name = "class" } },
|
||||
},
|
||||
new TagHelperDescriptor
|
||||
{
|
||||
TagName = "input",
|
||||
TypeName = "TestNamespace.InputTagHelper",
|
||||
AssemblyName = "SomeAssembly",
|
||||
Attributes = new TagHelperAttributeDescriptor[]
|
||||
{
|
||||
new TagHelperAttributeDescriptor("type", inputTypePropertyInfo)
|
||||
},
|
||||
RequiredAttributes = new[] { new TagHelperRequiredAttributeDescriptor { Name = "type" } },
|
||||
},
|
||||
new TagHelperDescriptor
|
||||
{
|
||||
TagName = "input",
|
||||
TypeName = "TestNamespace.InputTagHelper2",
|
||||
AssemblyName = "SomeAssembly",
|
||||
Attributes = new TagHelperAttributeDescriptor[]
|
||||
{
|
||||
new TagHelperAttributeDescriptor("type", inputTypePropertyInfo),
|
||||
new TagHelperAttributeDescriptor("checked", inputCheckedPropertyInfo)
|
||||
},
|
||||
RequiredAttributes = new[]
|
||||
{
|
||||
new TagHelperRequiredAttributeDescriptor { Name = "type" },
|
||||
new TagHelperRequiredAttributeDescriptor { Name = "checked" }
|
||||
},
|
||||
},
|
||||
new TagHelperDescriptor
|
||||
{
|
||||
TagName = "*",
|
||||
TypeName = "TestNamespace.CatchAllTagHelper",
|
||||
AssemblyName = "SomeAssembly",
|
||||
RequiredAttributes = new[] { new TagHelperRequiredAttributeDescriptor { Name = "catchAll" } },
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
internal static IEnumerable<TagHelperDescriptor> PrefixedAttributeTagHelperDescriptors
|
||||
{
|
||||
get
|
||||
{
|
||||
return new[]
|
||||
{
|
||||
new TagHelperDescriptor
|
||||
{
|
||||
TagName = "input",
|
||||
TypeName = "TestNamespace.InputTagHelper1",
|
||||
AssemblyName = "SomeAssembly",
|
||||
Attributes = new[]
|
||||
{
|
||||
new TagHelperAttributeDescriptor
|
||||
{
|
||||
Name = "int-prefix-grabber",
|
||||
PropertyName = "IntProperty",
|
||||
TypeName = typeof(int).FullName
|
||||
},
|
||||
new TagHelperAttributeDescriptor
|
||||
{
|
||||
Name = "int-dictionary",
|
||||
PropertyName = "IntDictionaryProperty",
|
||||
TypeName = typeof(IDictionary<string, int>).FullName
|
||||
},
|
||||
new TagHelperAttributeDescriptor
|
||||
{
|
||||
Name = "string-dictionary",
|
||||
PropertyName = "StringDictionaryProperty",
|
||||
TypeName = "Namespace.DictionaryWithoutParameterlessConstructor<string, string>"
|
||||
},
|
||||
new TagHelperAttributeDescriptor
|
||||
{
|
||||
Name = "string-prefix-grabber",
|
||||
PropertyName = "StringProperty",
|
||||
TypeName = typeof(string).FullName,
|
||||
IsStringProperty = true
|
||||
},
|
||||
new TagHelperAttributeDescriptor
|
||||
{
|
||||
Name = "int-prefix-",
|
||||
PropertyName = "IntDictionaryProperty",
|
||||
TypeName = typeof(int).FullName,
|
||||
IsIndexer = true
|
||||
},
|
||||
new TagHelperAttributeDescriptor
|
||||
{
|
||||
Name = "string-prefix-",
|
||||
PropertyName = "StringDictionaryProperty",
|
||||
TypeName = typeof(string).FullName,
|
||||
IsIndexer = true,
|
||||
IsStringProperty = true
|
||||
}
|
||||
}
|
||||
},
|
||||
new TagHelperDescriptor
|
||||
{
|
||||
TagName = "input",
|
||||
TypeName = "TestNamespace.InputTagHelper2",
|
||||
AssemblyName = "SomeAssembly",
|
||||
Attributes = new[]
|
||||
{
|
||||
new TagHelperAttributeDescriptor
|
||||
{
|
||||
Name = "int-dictionary",
|
||||
PropertyName = "IntDictionaryProperty",
|
||||
TypeName = typeof(int).FullName
|
||||
},
|
||||
new TagHelperAttributeDescriptor
|
||||
{
|
||||
Name = "string-dictionary",
|
||||
PropertyName = "StringDictionaryProperty",
|
||||
TypeName = "Namespace.DictionaryWithoutParameterlessConstructor<string, string>"
|
||||
},
|
||||
new TagHelperAttributeDescriptor
|
||||
{
|
||||
Name = "int-prefix-",
|
||||
PropertyName = "IntDictionaryProperty",
|
||||
TypeName = typeof(int).FullName,
|
||||
IsIndexer = true
|
||||
},
|
||||
new TagHelperAttributeDescriptor
|
||||
{
|
||||
Name = "string-prefix-",
|
||||
PropertyName = "StringDictionaryProperty",
|
||||
TypeName = typeof(string).FullName,
|
||||
IsIndexer = true,
|
||||
IsStringProperty = true
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private static IEnumerable<TagHelperDescriptor> BuildPAndInputTagHelperDescriptors(string prefix)
|
||||
{
|
||||
var pAgePropertyInfo = typeof(TestType).GetProperty("Age");
|
||||
var inputTypePropertyInfo = typeof(TestType).GetProperty("Type");
|
||||
var checkedPropertyInfo = typeof(TestType).GetProperty("Checked");
|
||||
|
||||
return new[]
|
||||
{
|
||||
new TagHelperDescriptor
|
||||
{
|
||||
Prefix = prefix,
|
||||
TagName = "p",
|
||||
TypeName = "TestNamespace.PTagHelper",
|
||||
AssemblyName = "SomeAssembly",
|
||||
Attributes = new TagHelperAttributeDescriptor[]
|
||||
{
|
||||
new TagHelperAttributeDescriptor("age", pAgePropertyInfo)
|
||||
},
|
||||
TagStructure = TagStructure.NormalOrSelfClosing
|
||||
},
|
||||
new TagHelperDescriptor
|
||||
{
|
||||
Prefix = prefix,
|
||||
TagName = "input",
|
||||
TypeName = "TestNamespace.InputTagHelper",
|
||||
AssemblyName = "SomeAssembly",
|
||||
Attributes = new TagHelperAttributeDescriptor[]
|
||||
{
|
||||
new TagHelperAttributeDescriptor("type", inputTypePropertyInfo)
|
||||
},
|
||||
TagStructure = TagStructure.WithoutEndTag
|
||||
},
|
||||
new TagHelperDescriptor
|
||||
{
|
||||
Prefix = prefix,
|
||||
TagName = "input",
|
||||
TypeName = "TestNamespace.InputTagHelper2",
|
||||
AssemblyName = "SomeAssembly",
|
||||
Attributes = new TagHelperAttributeDescriptor[]
|
||||
{
|
||||
new TagHelperAttributeDescriptor("type", inputTypePropertyInfo),
|
||||
new TagHelperAttributeDescriptor("checked", checkedPropertyInfo)
|
||||
},
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private class TestType
|
||||
{
|
||||
public int Age { get; set; }
|
||||
|
||||
public string Type { get; set; }
|
||||
|
||||
public bool Checked { get; set; }
|
||||
|
||||
public string BoundProperty { get; set; }
|
||||
}
|
||||
|
||||
public enum MyEnum
|
||||
{
|
||||
MyValue,
|
||||
MySecondValue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
@addTagHelper something, nice
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
@addTagHelper *, something
|
||||
|
||||
<p class="btn">
|
||||
<p><strong catchAll="hi">Hello</strong><strong>World</strong></p>
|
||||
<input checked="true" />
|
||||
<input type="checkbox" checked="true" />
|
||||
<input type="checkbox" checked="true" catchAll="hi" />
|
||||
</p>
|
||||
|
|
@ -0,0 +1,133 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "6c8b55df08e7538ff6155a5bc3b8135b305ad08a"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeTargetingTagHelpers_Runtime
|
||||
{
|
||||
#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 Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager(StartTagHelperWritingScope, EndTagHelperWritingScope);
|
||||
}
|
||||
return __backed__tagHelperScopeManager;
|
||||
}
|
||||
}
|
||||
private global::TestNamespace.PTagHelper __TestNamespace_PTagHelper = null;
|
||||
private global::TestNamespace.CatchAllTagHelper __TestNamespace_CatchAllTagHelper = null;
|
||||
private global::TestNamespace.InputTagHelper __TestNamespace_InputTagHelper = null;
|
||||
private global::TestNamespace.InputTagHelper2 __TestNamespace_InputTagHelper2 = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
WriteLiteral("\r\n");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagAndEndTag, "test", async() => {
|
||||
WriteLiteral("\r\n <p>");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("strong", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagAndEndTag, "test", async() => {
|
||||
WriteLiteral("Hello");
|
||||
}
|
||||
);
|
||||
__TestNamespace_CatchAllTagHelper = CreateTagHelper<global::TestNamespace.CatchAllTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_CatchAllTagHelper);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("hi");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("catchAll", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("<strong>World</strong></p>\r\n <input checked=\"true\" />\r\n ");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.SelfClosing, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_InputTagHelper = CreateTagHelper<global::TestNamespace.InputTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper);
|
||||
__TestNamespace_InputTagHelper2 = CreateTagHelper<global::TestNamespace.InputTagHelper2>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("checkbox");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__TestNamespace_InputTagHelper.Type = __tagHelperStringValueBuffer;
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper.Type, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
__TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type;
|
||||
#line 6 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers.cshtml"
|
||||
__TestNamespace_InputTagHelper2.Checked = true;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("checked", __TestNamespace_InputTagHelper2.Checked, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n ");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.SelfClosing, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_InputTagHelper = CreateTagHelper<global::TestNamespace.InputTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper);
|
||||
__TestNamespace_InputTagHelper2 = CreateTagHelper<global::TestNamespace.InputTagHelper2>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2);
|
||||
__TestNamespace_CatchAllTagHelper = CreateTagHelper<global::TestNamespace.CatchAllTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_CatchAllTagHelper);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("checkbox");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__TestNamespace_InputTagHelper.Type = __tagHelperStringValueBuffer;
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper.Type, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
__TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type;
|
||||
#line 7 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers.cshtml"
|
||||
__TestNamespace_InputTagHelper2.Checked = true;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("checked", __TestNamespace_InputTagHelper2.Checked, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("hi");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("catchAll", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n");
|
||||
}
|
||||
);
|
||||
__TestNamespace_PTagHelper = CreateTagHelper<global::TestNamespace.PTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_PTagHelper);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("btn");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("class", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
@addTagHelper "something, nice"
|
||||
|
||||
<div data-animation="fade" class="randomNonTagHelperAttribute">
|
||||
<p class="Hello World" data-delay="1000">
|
||||
<p data="-delay1000"></p>
|
||||
<input data-interval="2000 + @ViewBag.DefaultInterval + 1" type="text">
|
||||
<input type="checkbox" checked="true"/>
|
||||
</p>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
@tagHelperPrefix "THS"
|
||||
@addTagHelper something, nice
|
||||
|
||||
<THSdiv class="randomNonTagHelperAttribute">
|
||||
<THSp class="Hello World">
|
||||
<p></p>
|
||||
<input type="text">
|
||||
<THSinput type="checkbox" checked="true">
|
||||
</THSp>
|
||||
</THSdiv>
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "859f448778119fd3043b1f19ea3d1f695558d6a6"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers_Prefixed_Runtime
|
||||
{
|
||||
#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 Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager(StartTagHelperWritingScope, EndTagHelperWritingScope);
|
||||
}
|
||||
return __backed__tagHelperScopeManager;
|
||||
}
|
||||
}
|
||||
private global::TestNamespace.PTagHelper __TestNamespace_PTagHelper = null;
|
||||
private global::TestNamespace.InputTagHelper __TestNamespace_InputTagHelper = null;
|
||||
private global::TestNamespace.InputTagHelper2 __TestNamespace_InputTagHelper2 = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
WriteLiteral("\r\n<THSdiv class=\"randomNonTagHelperAttribute\">\r\n ");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("THSp", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagAndEndTag, "test", async() => {
|
||||
WriteLiteral("\r\n <p></p>\r\n <input type=\"text\">\r\n ");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("THSinput", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagOnly, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_InputTagHelper = CreateTagHelper<global::TestNamespace.InputTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper);
|
||||
__TestNamespace_InputTagHelper2 = CreateTagHelper<global::TestNamespace.InputTagHelper2>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("checkbox");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__TestNamespace_InputTagHelper.Type = __tagHelperStringValueBuffer;
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper.Type, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
__TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type;
|
||||
#line 8 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed.cshtml"
|
||||
__TestNamespace_InputTagHelper2.Checked = true;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("checked", __TestNamespace_InputTagHelper2.Checked, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n ");
|
||||
}
|
||||
);
|
||||
__TestNamespace_PTagHelper = CreateTagHelper<global::TestNamespace.PTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_PTagHelper);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("Hello World");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("class", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n</THSdiv>");
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
@addTagHelper something, nice
|
||||
@removeTagHelper "doesntmatter, nice"
|
||||
|
||||
<div class="randomNonTagHelperAttribute">
|
||||
<p class="Hello World">
|
||||
<p></p>
|
||||
<input type="text" />
|
||||
<input type="checkbox" checked="true"/>
|
||||
</p>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,134 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "02f53fe4a386cdc0885235e5fd3f5d6d317dd4d6"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers_Runtime
|
||||
{
|
||||
#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 Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager(StartTagHelperWritingScope, EndTagHelperWritingScope);
|
||||
}
|
||||
return __backed__tagHelperScopeManager;
|
||||
}
|
||||
}
|
||||
private global::TestNamespace.PTagHelper __TestNamespace_PTagHelper = null;
|
||||
private global::TestNamespace.InputTagHelper __TestNamespace_InputTagHelper = null;
|
||||
private global::TestNamespace.InputTagHelper2 __TestNamespace_InputTagHelper2 = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
WriteLiteral("\r\n<div data-animation=\"fade\" class=\"randomNonTagHelperAttribute\">\r\n ");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagAndEndTag, "test", async() => {
|
||||
WriteLiteral("\r\n ");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagAndEndTag, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_PTagHelper = CreateTagHelper<global::TestNamespace.PTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_PTagHelper);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("-delay1000");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("data", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n ");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagOnly, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_InputTagHelper = CreateTagHelper<global::TestNamespace.InputTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper);
|
||||
__TestNamespace_InputTagHelper2 = CreateTagHelper<global::TestNamespace.InputTagHelper2>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("2000 + ");
|
||||
#line 6 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers.cshtml"
|
||||
Write(ViewBag.DefaultInterval);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" + 1");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("data-interval", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("text");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__TestNamespace_InputTagHelper.Type = __tagHelperStringValueBuffer;
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper.Type, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
__TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type;
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n ");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.SelfClosing, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_InputTagHelper = CreateTagHelper<global::TestNamespace.InputTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper);
|
||||
__TestNamespace_InputTagHelper2 = CreateTagHelper<global::TestNamespace.InputTagHelper2>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("checkbox");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__TestNamespace_InputTagHelper.Type = __tagHelperStringValueBuffer;
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper.Type, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
__TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type;
|
||||
#line 7 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers.cshtml"
|
||||
__TestNamespace_InputTagHelper2.Checked = true;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("checked", __TestNamespace_InputTagHelper2.Checked, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n ");
|
||||
}
|
||||
);
|
||||
__TestNamespace_PTagHelper = CreateTagHelper<global::TestNamespace.PTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_PTagHelper);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("Hello World");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("class", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("1000");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("data-delay", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n</div>");
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
@addTagHelper something, nice
|
||||
|
||||
@if (true)
|
||||
{
|
||||
var checkbox = "checkbox";
|
||||
|
||||
<div class="randomNonTagHelperAttribute">
|
||||
<p time="Current Time: @DateTime.Now">
|
||||
<h1>Set Time:</h1>
|
||||
@if (false)
|
||||
{
|
||||
<p>New Time: <input type="text" value="" placeholder="Enter in a new time..."/></p>
|
||||
}
|
||||
else
|
||||
{
|
||||
<p>Current Time: <input type=@checkbox checked=true /></p>
|
||||
<input tYPe='@(true ? "checkbox" : "anything")' />
|
||||
<input type='@if(true) { <text>checkbox</text> } else { <text>anything</text> }'>
|
||||
}
|
||||
</p>
|
||||
<p unbound="first value" age="@DateTimeOffset.Now.Year - 1970" unbound="second value" >
|
||||
@{ var @object = false;}
|
||||
<input ChecKED="@(@object)">
|
||||
</p>
|
||||
<p age="-1970 + @DateTimeOffset.Now.Year">
|
||||
<input unbound="hello" unbound="world" checked="@(DateTimeOffset.Now.Year > 2014)" />
|
||||
</p>
|
||||
<p age="DateTimeOffset.Now.Year - 1970">
|
||||
<input checked="DateTimeOffset.Now.Year > 2014">
|
||||
</p>
|
||||
<p age="@("My age is this long.".Length)">
|
||||
<input checked=" @( DateTimeOffset.Now.Year ) > 2014 " />
|
||||
</p>
|
||||
@someMethod(@<p age="123" class="hello"><input checked=@checked /></p>)
|
||||
</div>
|
||||
}
|
||||
|
|
@ -0,0 +1,482 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "3cc5f5ed458e4e33874c4242798b195a31ab065c"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ComplexTagHelpers_Runtime
|
||||
{
|
||||
#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 Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager(StartTagHelperWritingScope, EndTagHelperWritingScope);
|
||||
}
|
||||
return __backed__tagHelperScopeManager;
|
||||
}
|
||||
}
|
||||
private global::TestNamespace.PTagHelper __TestNamespace_PTagHelper = null;
|
||||
private global::TestNamespace.InputTagHelper __TestNamespace_InputTagHelper = null;
|
||||
private global::TestNamespace.InputTagHelper2 __TestNamespace_InputTagHelper2 = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
WriteLiteral("\r\n");
|
||||
#line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml"
|
||||
if (true)
|
||||
{
|
||||
var checkbox = "checkbox";
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div class=\"randomNonTagHelperAttribute\">\r\n ");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagAndEndTag, "test", async() => {
|
||||
WriteLiteral("\r\n <h1>Set Time:</h1>\r\n");
|
||||
#line 10 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml"
|
||||
if (false)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagAndEndTag, "test", async() => {
|
||||
WriteLiteral("New Time: ");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.SelfClosing, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_InputTagHelper = CreateTagHelper<global::TestNamespace.InputTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper);
|
||||
__TestNamespace_InputTagHelper2 = CreateTagHelper<global::TestNamespace.InputTagHelper2>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("text");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__TestNamespace_InputTagHelper.Type = __tagHelperStringValueBuffer;
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper.Type, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
__TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type;
|
||||
BeginWriteTagHelperAttribute();
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("value", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("Enter in a new time...");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("placeholder", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
}
|
||||
);
|
||||
__TestNamespace_PTagHelper = CreateTagHelper<global::TestNamespace.PTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_PTagHelper);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n");
|
||||
#line 13 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagAndEndTag, "test", async() => {
|
||||
WriteLiteral("Current Time: ");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.SelfClosing, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_InputTagHelper = CreateTagHelper<global::TestNamespace.InputTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper);
|
||||
__TestNamespace_InputTagHelper2 = CreateTagHelper<global::TestNamespace.InputTagHelper2>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2);
|
||||
BeginWriteTagHelperAttribute();
|
||||
#line 16 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml"
|
||||
WriteLiteral(checkbox);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__TestNamespace_InputTagHelper.Type = __tagHelperStringValueBuffer;
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper.Type, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
__TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type;
|
||||
#line 16 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml"
|
||||
__TestNamespace_InputTagHelper2.Checked = true;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("checked", __TestNamespace_InputTagHelper2.Checked, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
}
|
||||
);
|
||||
__TestNamespace_PTagHelper = CreateTagHelper<global::TestNamespace.PTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_PTagHelper);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n ");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.SelfClosing, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_InputTagHelper = CreateTagHelper<global::TestNamespace.InputTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper);
|
||||
__TestNamespace_InputTagHelper2 = CreateTagHelper<global::TestNamespace.InputTagHelper2>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2);
|
||||
BeginWriteTagHelperAttribute();
|
||||
#line 17 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml"
|
||||
WriteLiteral(true ? "checkbox" : "anything");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__TestNamespace_InputTagHelper.Type = __tagHelperStringValueBuffer;
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("tYPe", __TestNamespace_InputTagHelper.Type, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.SingleQuotes);
|
||||
__TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type;
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n ");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagOnly, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_InputTagHelper = CreateTagHelper<global::TestNamespace.InputTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper);
|
||||
__TestNamespace_InputTagHelper2 = CreateTagHelper<global::TestNamespace.InputTagHelper2>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2);
|
||||
BeginWriteTagHelperAttribute();
|
||||
#line 18 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml"
|
||||
if(true) {
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("checkbox");
|
||||
#line 18 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml"
|
||||
} else {
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("anything");
|
||||
#line 18 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__TestNamespace_InputTagHelper.Type = __tagHelperStringValueBuffer;
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper.Type, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.SingleQuotes);
|
||||
__TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type;
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n");
|
||||
#line 19 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
}
|
||||
);
|
||||
__TestNamespace_PTagHelper = CreateTagHelper<global::TestNamespace.PTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_PTagHelper);
|
||||
BeginAddHtmlAttributeValues(__tagHelperExecutionContext, "time", 3, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
AddHtmlAttributeValue("", 146, "Current", 146, 7, true);
|
||||
AddHtmlAttributeValue(" ", 153, "Time:", 154, 6, true);
|
||||
#line 8 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml"
|
||||
AddHtmlAttributeValue(" ", 159, DateTime.Now, 160, 13, false);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
EndAddHtmlAttributeValues(__tagHelperExecutionContext);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n ");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagAndEndTag, "test", async() => {
|
||||
WriteLiteral("\r\n");
|
||||
#line 22 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml"
|
||||
var @object = false;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagOnly, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_InputTagHelper = CreateTagHelper<global::TestNamespace.InputTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper);
|
||||
__TestNamespace_InputTagHelper2 = CreateTagHelper<global::TestNamespace.InputTagHelper2>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2);
|
||||
#line 23 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml"
|
||||
__TestNamespace_InputTagHelper2.Checked = (@object);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("ChecKED", __TestNamespace_InputTagHelper2.Checked, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n ");
|
||||
}
|
||||
);
|
||||
__TestNamespace_PTagHelper = CreateTagHelper<global::TestNamespace.PTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_PTagHelper);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("first value");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("unbound", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
#line 21 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml"
|
||||
__TestNamespace_PTagHelper.Age = DateTimeOffset.Now.Year - 1970;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("age", __TestNamespace_PTagHelper.Age, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("second value");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("unbound", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n ");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagAndEndTag, "test", async() => {
|
||||
WriteLiteral("\r\n ");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.SelfClosing, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_InputTagHelper = CreateTagHelper<global::TestNamespace.InputTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper);
|
||||
__TestNamespace_InputTagHelper2 = CreateTagHelper<global::TestNamespace.InputTagHelper2>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("hello");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("unbound", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("world");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("unbound", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
#line 26 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml"
|
||||
__TestNamespace_InputTagHelper2.Checked = (DateTimeOffset.Now.Year > 2014);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("checked", __TestNamespace_InputTagHelper2.Checked, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n ");
|
||||
}
|
||||
);
|
||||
__TestNamespace_PTagHelper = CreateTagHelper<global::TestNamespace.PTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_PTagHelper);
|
||||
#line 25 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml"
|
||||
__TestNamespace_PTagHelper.Age = -1970 + @DateTimeOffset.Now.Year;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("age", __TestNamespace_PTagHelper.Age, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n ");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagAndEndTag, "test", async() => {
|
||||
WriteLiteral("\r\n ");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagOnly, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_InputTagHelper = CreateTagHelper<global::TestNamespace.InputTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper);
|
||||
__TestNamespace_InputTagHelper2 = CreateTagHelper<global::TestNamespace.InputTagHelper2>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2);
|
||||
#line 29 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml"
|
||||
__TestNamespace_InputTagHelper2.Checked = DateTimeOffset.Now.Year > 2014;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("checked", __TestNamespace_InputTagHelper2.Checked, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n ");
|
||||
}
|
||||
);
|
||||
__TestNamespace_PTagHelper = CreateTagHelper<global::TestNamespace.PTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_PTagHelper);
|
||||
#line 28 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml"
|
||||
__TestNamespace_PTagHelper.Age = DateTimeOffset.Now.Year - 1970;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("age", __TestNamespace_PTagHelper.Age, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n ");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagAndEndTag, "test", async() => {
|
||||
WriteLiteral("\r\n ");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.SelfClosing, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_InputTagHelper = CreateTagHelper<global::TestNamespace.InputTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper);
|
||||
__TestNamespace_InputTagHelper2 = CreateTagHelper<global::TestNamespace.InputTagHelper2>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2);
|
||||
#line 32 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml"
|
||||
__TestNamespace_InputTagHelper2.Checked = @( DateTimeOffset.Now.Year ) > 2014 ;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("checked", __TestNamespace_InputTagHelper2.Checked, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n ");
|
||||
}
|
||||
);
|
||||
__TestNamespace_PTagHelper = CreateTagHelper<global::TestNamespace.PTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_PTagHelper);
|
||||
#line 31 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml"
|
||||
__TestNamespace_PTagHelper.Age = ("My age is this long.".Length);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("age", __TestNamespace_PTagHelper.Age, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n ");
|
||||
#line 34 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml"
|
||||
Write(someMethod(item => new HelperResult(async(__razor_template_writer) => {
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagAndEndTag, "test", async() => {
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.SelfClosing, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_InputTagHelper = CreateTagHelper<global::TestNamespace.InputTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper);
|
||||
__TestNamespace_InputTagHelper2 = CreateTagHelper<global::TestNamespace.InputTagHelper2>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2);
|
||||
#line 34 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml"
|
||||
__TestNamespace_InputTagHelper2.Checked = checked;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("checked", __TestNamespace_InputTagHelper2.Checked, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
}
|
||||
);
|
||||
__TestNamespace_PTagHelper = CreateTagHelper<global::TestNamespace.PTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_PTagHelper);
|
||||
#line 34 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml"
|
||||
__TestNamespace_PTagHelper.Age = 123;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("age", __TestNamespace_PTagHelper.Age, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("hello");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("class", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
WriteTo(__razor_template_writer, __tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
}
|
||||
)));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </div>\r\n");
|
||||
#line 36 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
@addTagHelper "*, something"
|
||||
|
||||
<a href="~/">2 TagHelpers.</a>
|
||||
<a href=~/hello>1 TagHelper.</a>
|
||||
<a href="~/?hello=world">2 TagHelpers</a>
|
||||
<a href="~/@false?hello=world">2 TagHelpers</a>
|
||||
<a href=' ~/'>0 TagHelpers.</a>
|
||||
<a href=~/@false>1 TagHelper</a>
|
||||
<a href="~/?hello=world@false">1 TagHelper</a>
|
||||
<a href='~/?hello=world @false'>1 TagHelper</a>
|
||||
<input type="text" value="3 TagHelpers" />
|
||||
<input type='texty' value="3 TagHelpers" />
|
||||
<input type="checkbox" value="2 TagHelper" />
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
@addTagHelper something, nice
|
||||
|
||||
<p age="3" AGE="40" Age="500">
|
||||
<input type="button" TYPE="checkbox" />
|
||||
<input type="button" checked="true" type="checkbox" checked="false" />
|
||||
<input type='button' checked="true" type=checkbox checked='true' type="checkbox" checked=true />
|
||||
</p>
|
||||
|
|
@ -0,0 +1,167 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "b7cbc77774bfe558f4548cc5b3760f88754a329e"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateAttributeTagHelpers_Runtime
|
||||
{
|
||||
#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 Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager(StartTagHelperWritingScope, EndTagHelperWritingScope);
|
||||
}
|
||||
return __backed__tagHelperScopeManager;
|
||||
}
|
||||
}
|
||||
private global::TestNamespace.PTagHelper __TestNamespace_PTagHelper = null;
|
||||
private global::TestNamespace.InputTagHelper __TestNamespace_InputTagHelper = null;
|
||||
private global::TestNamespace.InputTagHelper2 __TestNamespace_InputTagHelper2 = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
WriteLiteral("\r\n");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagAndEndTag, "test", async() => {
|
||||
WriteLiteral("\r\n ");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.SelfClosing, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_InputTagHelper = CreateTagHelper<global::TestNamespace.InputTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper);
|
||||
__TestNamespace_InputTagHelper2 = CreateTagHelper<global::TestNamespace.InputTagHelper2>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("button");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__TestNamespace_InputTagHelper.Type = __tagHelperStringValueBuffer;
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper.Type, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
__TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type;
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("checkbox");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("TYPE", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n ");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.SelfClosing, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_InputTagHelper = CreateTagHelper<global::TestNamespace.InputTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper);
|
||||
__TestNamespace_InputTagHelper2 = CreateTagHelper<global::TestNamespace.InputTagHelper2>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("button");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__TestNamespace_InputTagHelper.Type = __tagHelperStringValueBuffer;
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper.Type, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
__TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type;
|
||||
#line 5 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers.cshtml"
|
||||
__TestNamespace_InputTagHelper2.Checked = true;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("checked", __TestNamespace_InputTagHelper2.Checked, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("checkbox");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("type", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("false");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("checked", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n ");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.SelfClosing, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_InputTagHelper = CreateTagHelper<global::TestNamespace.InputTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper);
|
||||
__TestNamespace_InputTagHelper2 = CreateTagHelper<global::TestNamespace.InputTagHelper2>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("button");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__TestNamespace_InputTagHelper.Type = __tagHelperStringValueBuffer;
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper.Type, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.SingleQuotes);
|
||||
__TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type;
|
||||
#line 6 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers.cshtml"
|
||||
__TestNamespace_InputTagHelper2.Checked = true;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("checked", __TestNamespace_InputTagHelper2.Checked, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("checkbox");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("type", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("true");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("checked", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.SingleQuotes);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("checkbox");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("type", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("true");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("checked", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n");
|
||||
}
|
||||
);
|
||||
__TestNamespace_PTagHelper = CreateTagHelper<global::TestNamespace.PTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_PTagHelper);
|
||||
#line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers.cshtml"
|
||||
__TestNamespace_PTagHelper.Age = 3;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("age", __TestNamespace_PTagHelper.Age, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("40");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("AGE", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("500");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("Age", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
@addTagHelper something, nice
|
||||
|
||||
<input type="checkbox" checked="true" />
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "1014725b9048d825ce97b0e5e260ac35f057fe0a"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateTargetTagHelper_Runtime
|
||||
{
|
||||
#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 Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager(StartTagHelperWritingScope, EndTagHelperWritingScope);
|
||||
}
|
||||
return __backed__tagHelperScopeManager;
|
||||
}
|
||||
}
|
||||
private global::TestNamespace.InputTagHelper __TestNamespace_InputTagHelper = null;
|
||||
private global::TestNamespace.CatchAllTagHelper __TestNamespace_CatchAllTagHelper = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
WriteLiteral("\r\n");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.SelfClosing, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_InputTagHelper = CreateTagHelper<global::TestNamespace.InputTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper);
|
||||
__TestNamespace_InputTagHelper = CreateTagHelper<global::TestNamespace.InputTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper);
|
||||
__TestNamespace_CatchAllTagHelper = CreateTagHelper<global::TestNamespace.CatchAllTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_CatchAllTagHelper);
|
||||
__TestNamespace_CatchAllTagHelper = CreateTagHelper<global::TestNamespace.CatchAllTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_CatchAllTagHelper);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("checkbox");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__TestNamespace_InputTagHelper.Type = __tagHelperStringValueBuffer;
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper.Type, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
__TestNamespace_InputTagHelper.Type = __TestNamespace_InputTagHelper.Type;
|
||||
__TestNamespace_CatchAllTagHelper.Type = __TestNamespace_InputTagHelper.Type;
|
||||
__TestNamespace_CatchAllTagHelper.Type = __TestNamespace_InputTagHelper.Type;
|
||||
#line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper.cshtml"
|
||||
__TestNamespace_InputTagHelper.Checked = true;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("checked", __TestNamespace_InputTagHelper.Checked, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
__TestNamespace_InputTagHelper.Checked = __TestNamespace_InputTagHelper.Checked;
|
||||
__TestNamespace_CatchAllTagHelper.Checked = __TestNamespace_InputTagHelper.Checked;
|
||||
__TestNamespace_CatchAllTagHelper.Checked = __TestNamespace_InputTagHelper.Checked;
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
@addTagHelper something, nice
|
||||
|
||||
<input unbound="prefix @DateTime.Now" />
|
||||
|
||||
<input unbound="@if (true) { @string.Empty } else { @false } suffix" />
|
||||
|
||||
<input bound="prefix @DateTime.Now suffix" unbound="prefix @DateTime.Now suffix" />
|
||||
|
||||
<input bound="@long.MinValue @if (true) { @string.Empty } else { @false } @int.MaxValue"
|
||||
unbound="@long.MinValue @if (true) { @string.Empty } else { @false } @int.MaxValue" />
|
||||
|
||||
<input unbound="@long.MinValue @DateTime.Now static content @int.MaxValue" />
|
||||
|
||||
<input unbound="@if (true) { @string.Empty } else { @false }" />
|
||||
|
|
@ -0,0 +1,301 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "107e341010aad754fc5c952722dbfdc7e33fc38e"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DynamicAttributeTagHelpers_Runtime
|
||||
{
|
||||
#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 Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager(StartTagHelperWritingScope, EndTagHelperWritingScope);
|
||||
}
|
||||
return __backed__tagHelperScopeManager;
|
||||
}
|
||||
}
|
||||
private global::TestNamespace.InputTagHelper __TestNamespace_InputTagHelper = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
WriteLiteral("\r\n");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.SelfClosing, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_InputTagHelper = CreateTagHelper<global::TestNamespace.InputTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper);
|
||||
BeginAddHtmlAttributeValues(__tagHelperExecutionContext, "unbound", 2, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
AddHtmlAttributeValue("", 49, "prefix", 49, 6, true);
|
||||
#line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml"
|
||||
AddHtmlAttributeValue(" ", 55, DateTime.Now, 56, 13, false);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
EndAddHtmlAttributeValues(__tagHelperExecutionContext);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n\r\n");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.SelfClosing, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_InputTagHelper = CreateTagHelper<global::TestNamespace.InputTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper);
|
||||
BeginAddHtmlAttributeValues(__tagHelperExecutionContext, "unbound", 2, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
AddHtmlAttributeValue("", 93, new HelperResult(async(__razor_attribute_value_writer) => {
|
||||
#line 5 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml"
|
||||
if (true) {
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 5 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml"
|
||||
WriteTo(__razor_attribute_value_writer, string.Empty);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 5 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml"
|
||||
} else {
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 5 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml"
|
||||
WriteTo(__razor_attribute_value_writer, false);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 5 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
}
|
||||
), 93, 44, false);
|
||||
AddHtmlAttributeValue(" ", 137, "suffix", 138, 7, true);
|
||||
EndAddHtmlAttributeValues(__tagHelperExecutionContext);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n\r\n");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.SelfClosing, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_InputTagHelper = CreateTagHelper<global::TestNamespace.InputTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("prefix ");
|
||||
#line 7 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml"
|
||||
WriteLiteral(DateTime.Now);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" suffix");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__TestNamespace_InputTagHelper.Bound = __tagHelperStringValueBuffer;
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("bound", __TestNamespace_InputTagHelper.Bound, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
BeginAddHtmlAttributeValues(__tagHelperExecutionContext, "unbound", 3, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
AddHtmlAttributeValue("", 204, "prefix", 204, 6, true);
|
||||
#line 7 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml"
|
||||
AddHtmlAttributeValue(" ", 210, DateTime.Now, 211, 13, false);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
AddHtmlAttributeValue(" ", 224, "suffix", 225, 7, true);
|
||||
EndAddHtmlAttributeValues(__tagHelperExecutionContext);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n\r\n");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.SelfClosing, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_InputTagHelper = CreateTagHelper<global::TestNamespace.InputTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper);
|
||||
BeginWriteTagHelperAttribute();
|
||||
#line 9 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml"
|
||||
WriteLiteral(long.MinValue);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
#line 9 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml"
|
||||
if (true) {
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 9 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml"
|
||||
WriteLiteral(string.Empty);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 9 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml"
|
||||
} else {
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 9 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml"
|
||||
WriteLiteral(false);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 9 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
#line 9 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml"
|
||||
WriteLiteral(int.MaxValue);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__TestNamespace_InputTagHelper.Bound = __tagHelperStringValueBuffer;
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("bound", __TestNamespace_InputTagHelper.Bound, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
BeginAddHtmlAttributeValues(__tagHelperExecutionContext, "unbound", 3, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
#line 10 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml"
|
||||
AddHtmlAttributeValue("", 345, long.MinValue, 345, 14, false);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
AddHtmlAttributeValue(" ", 359, new HelperResult(async(__razor_attribute_value_writer) => {
|
||||
#line 10 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml"
|
||||
if (true) {
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 10 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml"
|
||||
WriteTo(__razor_attribute_value_writer, string.Empty);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 10 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml"
|
||||
} else {
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 10 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml"
|
||||
WriteTo(__razor_attribute_value_writer, false);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 10 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
}
|
||||
), 360, 44, false);
|
||||
#line 10 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml"
|
||||
AddHtmlAttributeValue(" ", 404, int.MaxValue, 405, 13, false);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
EndAddHtmlAttributeValues(__tagHelperExecutionContext);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n\r\n");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.SelfClosing, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_InputTagHelper = CreateTagHelper<global::TestNamespace.InputTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper);
|
||||
BeginAddHtmlAttributeValues(__tagHelperExecutionContext, "unbound", 5, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
#line 12 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml"
|
||||
AddHtmlAttributeValue("", 442, long.MinValue, 442, 14, false);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 12 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml"
|
||||
AddHtmlAttributeValue(" ", 456, DateTime.Now, 457, 13, false);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
AddHtmlAttributeValue(" ", 470, "static", 471, 7, true);
|
||||
AddHtmlAttributeValue(" ", 477, "content", 481, 11, true);
|
||||
#line 12 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml"
|
||||
AddHtmlAttributeValue(" ", 488, int.MaxValue, 489, 13, false);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
EndAddHtmlAttributeValues(__tagHelperExecutionContext);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n\r\n");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.SelfClosing, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_InputTagHelper = CreateTagHelper<global::TestNamespace.InputTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper);
|
||||
BeginAddHtmlAttributeValues(__tagHelperExecutionContext, "unbound", 1, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
AddHtmlAttributeValue("", 526, new HelperResult(async(__razor_attribute_value_writer) => {
|
||||
#line 14 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml"
|
||||
if (true) {
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 14 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml"
|
||||
WriteTo(__razor_attribute_value_writer, string.Empty);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 14 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml"
|
||||
} else {
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 14 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml"
|
||||
WriteTo(__razor_attribute_value_writer, false);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 14 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
}
|
||||
), 526, 44, false);
|
||||
EndAddHtmlAttributeValues(__tagHelperExecutionContext);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
@addTagHelper something
|
||||
|
||||
<div>
|
||||
<input type= checked=""class="" />
|
||||
<p age=''>
|
||||
<input type=""checked= class="" />
|
||||
</p>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "ab5e45403d2c57cfdbab9546c3a27eea94f0fb5c"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyAttributeTagHelpers_Runtime
|
||||
{
|
||||
#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 Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager(StartTagHelperWritingScope, EndTagHelperWritingScope);
|
||||
}
|
||||
return __backed__tagHelperScopeManager;
|
||||
}
|
||||
}
|
||||
private global::TestNamespace.InputTagHelper __TestNamespace_InputTagHelper = null;
|
||||
private global::TestNamespace.InputTagHelper2 __TestNamespace_InputTagHelper2 = null;
|
||||
private global::TestNamespace.PTagHelper __TestNamespace_PTagHelper = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
WriteLiteral("\r\n<div>\r\n ");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.SelfClosing, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_InputTagHelper = CreateTagHelper<global::TestNamespace.InputTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper);
|
||||
__TestNamespace_InputTagHelper2 = CreateTagHelper<global::TestNamespace.InputTagHelper2>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2);
|
||||
BeginWriteTagHelperAttribute();
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__TestNamespace_InputTagHelper.Type = __tagHelperStringValueBuffer;
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper.Type, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
__TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type;
|
||||
#line 4 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers.cshtml"
|
||||
__TestNamespace_InputTagHelper2.Checked = ;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("checked", __TestNamespace_InputTagHelper2.Checked, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
BeginWriteTagHelperAttribute();
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("class", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n ");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagAndEndTag, "test", async() => {
|
||||
WriteLiteral("\r\n ");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.SelfClosing, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_InputTagHelper = CreateTagHelper<global::TestNamespace.InputTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper);
|
||||
__TestNamespace_InputTagHelper2 = CreateTagHelper<global::TestNamespace.InputTagHelper2>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2);
|
||||
BeginWriteTagHelperAttribute();
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__TestNamespace_InputTagHelper.Type = __tagHelperStringValueBuffer;
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper.Type, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
__TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type;
|
||||
#line 6 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers.cshtml"
|
||||
__TestNamespace_InputTagHelper2.Checked = ;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("checked", __TestNamespace_InputTagHelper2.Checked, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
BeginWriteTagHelperAttribute();
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("class", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n ");
|
||||
}
|
||||
);
|
||||
__TestNamespace_PTagHelper = CreateTagHelper<global::TestNamespace.PTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_PTagHelper);
|
||||
#line 5 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers.cshtml"
|
||||
__TestNamespace_PTagHelper.Age = ;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("age", __TestNamespace_PTagHelper.Age, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.SingleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n</div>");
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
@addTagHelper something, nice
|
||||
|
||||
@{
|
||||
var enumValue = MyEnum.MyValue;
|
||||
}
|
||||
|
||||
<input value="@MyEnum.MyValue" />
|
||||
<input class="@MyEnum.MySecondValue" />
|
||||
<input value="MyValue" />
|
||||
<input value="MySecondValue" catch-all="MyValue"/>
|
||||
<input value="@enumValue" catch-all="@enumValue" />
|
||||
|
|
@ -0,0 +1,162 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "f9124dcd7da8c06ab193a971690c676c5e0adaac"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EnumTagHelpers_Runtime
|
||||
{
|
||||
#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 Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager(StartTagHelperWritingScope, EndTagHelperWritingScope);
|
||||
}
|
||||
return __backed__tagHelperScopeManager;
|
||||
}
|
||||
}
|
||||
private global::TestNamespace.InputTagHelper __TestNamespace_InputTagHelper = null;
|
||||
private global::TestNamespace.CatchAllTagHelper __TestNamespace_CatchAllTagHelper = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
WriteLiteral("\r\n");
|
||||
#line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml"
|
||||
|
||||
var enumValue = MyEnum.MyValue;
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.SelfClosing, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_InputTagHelper = CreateTagHelper<global::TestNamespace.InputTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper);
|
||||
__TestNamespace_CatchAllTagHelper = CreateTagHelper<global::TestNamespace.CatchAllTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_CatchAllTagHelper);
|
||||
#line 7 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml"
|
||||
__TestNamespace_InputTagHelper.Value = MyEnum.MyValue;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("value", __TestNamespace_InputTagHelper.Value, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.SelfClosing, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_InputTagHelper = CreateTagHelper<global::TestNamespace.InputTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper);
|
||||
__TestNamespace_CatchAllTagHelper = CreateTagHelper<global::TestNamespace.CatchAllTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_CatchAllTagHelper);
|
||||
BeginAddHtmlAttributeValues(__tagHelperExecutionContext, "class", 1, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
#line 8 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml"
|
||||
AddHtmlAttributeValue("", 128, MyEnum.MySecondValue, 128, 21, false);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
EndAddHtmlAttributeValues(__tagHelperExecutionContext);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.SelfClosing, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_InputTagHelper = CreateTagHelper<global::TestNamespace.InputTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper);
|
||||
__TestNamespace_CatchAllTagHelper = CreateTagHelper<global::TestNamespace.CatchAllTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_CatchAllTagHelper);
|
||||
#line 9 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml"
|
||||
__TestNamespace_InputTagHelper.Value = global::Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestTagHelperDescriptors+MyEnum.MyValue;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("value", __TestNamespace_InputTagHelper.Value, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.SelfClosing, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_InputTagHelper = CreateTagHelper<global::TestNamespace.InputTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper);
|
||||
__TestNamespace_CatchAllTagHelper = CreateTagHelper<global::TestNamespace.CatchAllTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_CatchAllTagHelper);
|
||||
#line 10 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml"
|
||||
__TestNamespace_InputTagHelper.Value = global::Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestTagHelperDescriptors+MyEnum.MySecondValue;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("value", __TestNamespace_InputTagHelper.Value, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
#line 10 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml"
|
||||
__TestNamespace_CatchAllTagHelper.CatchAll = global::Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestTagHelperDescriptors+MyEnum.MyValue;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("catch-all", __TestNamespace_CatchAllTagHelper.CatchAll, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.SelfClosing, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_InputTagHelper = CreateTagHelper<global::TestNamespace.InputTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper);
|
||||
__TestNamespace_CatchAllTagHelper = CreateTagHelper<global::TestNamespace.CatchAllTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_CatchAllTagHelper);
|
||||
#line 11 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml"
|
||||
__TestNamespace_InputTagHelper.Value = enumValue;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("value", __TestNamespace_InputTagHelper.Value, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
#line 11 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml"
|
||||
__TestNamespace_CatchAllTagHelper.CatchAll = enumValue;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("catch-all", __TestNamespace_CatchAllTagHelper.CatchAll, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n");
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
@addTagHelper something
|
||||
|
||||
<!div class="randomNonTagHelperAttribute">
|
||||
<!p class="Hello World" @DateTime.Now>
|
||||
<!input type="text" />
|
||||
<!em>Not a TagHelper: </!em> <input type="@DateTime.Now" checked="true" />
|
||||
</!p>
|
||||
</!div>
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "93da17a7091c4d218cfc54282dec1b7b7beac072"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedTagHelpers_Runtime
|
||||
{
|
||||
#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 Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager(StartTagHelperWritingScope, EndTagHelperWritingScope);
|
||||
}
|
||||
return __backed__tagHelperScopeManager;
|
||||
}
|
||||
}
|
||||
private global::TestNamespace.InputTagHelper __TestNamespace_InputTagHelper = null;
|
||||
private global::TestNamespace.InputTagHelper2 __TestNamespace_InputTagHelper2 = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
WriteLiteral("\r\n<div class=\"randomNonTagHelperAttribute\">\r\n <p class=\"Hello World\" ");
|
||||
#line 4 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers.cshtml"
|
||||
Write(DateTime.Now);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(">\r\n <input type=\"text\" />\r\n <em>Not a TagHelper: </em> ");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.SelfClosing, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_InputTagHelper = CreateTagHelper<global::TestNamespace.InputTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper);
|
||||
__TestNamespace_InputTagHelper2 = CreateTagHelper<global::TestNamespace.InputTagHelper2>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2);
|
||||
BeginWriteTagHelperAttribute();
|
||||
#line 6 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers.cshtml"
|
||||
WriteLiteral(DateTime.Now);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__TestNamespace_InputTagHelper.Type = __tagHelperStringValueBuffer;
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper.Type, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
__TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type;
|
||||
#line 6 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers.cshtml"
|
||||
__TestNamespace_InputTagHelper2.Checked = true;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("checked", __TestNamespace_InputTagHelper2.Checked, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n </p>\r\n</div>");
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
@addTagHelper something, nice
|
||||
|
||||
<p class="
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "762284e0617212ef833fd39f08039bf078039570"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_IncompleteTagHelper_Runtime
|
||||
{
|
||||
#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 Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager(StartTagHelperWritingScope, EndTagHelperWritingScope);
|
||||
}
|
||||
return __backed__tagHelperScopeManager;
|
||||
}
|
||||
}
|
||||
private global::TestNamespace.PTagHelper __TestNamespace_PTagHelper = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
WriteLiteral("\r\n");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagAndEndTag, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_PTagHelper = CreateTagHelper<global::TestNamespace.PTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_PTagHelper);
|
||||
BeginWriteTagHelperAttribute();
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("class", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
@addTagHelper something, nice
|
||||
|
||||
<p catchall-unbound-required>
|
||||
<input nottaghelper />
|
||||
<input class="btn"
|
||||
catchall-unbound-required />
|
||||
<input
|
||||
class="btn" catchall-unbound-required input-unbound-required input-bound-required-string="hello" />
|
||||
<input
|
||||
class="btn"
|
||||
catchall-unbound-required
|
||||
input-unbound-required catchall-bound-string="world" input-bound-required-string="hello2" />
|
||||
<input class="btn"
|
||||
catchall-unbound-required="hello"
|
||||
input-unbound-required="hello2"
|
||||
catchall-unbound-required
|
||||
input-bound-required-string="world" />
|
||||
</p>
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
@addTagHelper something, nice
|
||||
|
||||
<script type="text/html">
|
||||
<div data-animation="fade" class="randomNonTagHelperAttribute">
|
||||
<p class="Hello World" data-delay="1000">
|
||||
@for(var i = 0; i < 5; i++) {
|
||||
<script id="nestedScriptTag" type="text/html">
|
||||
<input data-interval="2000 + @ViewBag.DefaultInterval + 1" type="text" checked="true">
|
||||
</script>
|
||||
}
|
||||
<script type="text/javascript">
|
||||
var tag = '<input checked="true">';
|
||||
</script>
|
||||
</p>
|
||||
</div>
|
||||
</script>
|
||||
|
|
@ -0,0 +1,110 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "e3cbc45bc2d4185bf69128f14721795d68e6961a"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedScriptTagTagHelpers_Runtime
|
||||
{
|
||||
#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 Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager(StartTagHelperWritingScope, EndTagHelperWritingScope);
|
||||
}
|
||||
return __backed__tagHelperScopeManager;
|
||||
}
|
||||
}
|
||||
private global::TestNamespace.PTagHelper __TestNamespace_PTagHelper = null;
|
||||
private global::TestNamespace.InputTagHelper __TestNamespace_InputTagHelper = null;
|
||||
private global::TestNamespace.InputTagHelper2 __TestNamespace_InputTagHelper2 = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
WriteLiteral("\r\n<script type=\"text/html\">\r\n <div data-animation=\"fade\" class=\"randomNonTagHelperAttribute\">\r\n ");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagAndEndTag, "test", async() => {
|
||||
WriteLiteral("\r\n");
|
||||
#line 6 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers.cshtml"
|
||||
for(var i = 0; i < 5; i++) {
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <script id=\"nestedScriptTag\" type=\"text/html\">\r\n ");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagOnly, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_InputTagHelper = CreateTagHelper<global::TestNamespace.InputTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper);
|
||||
__TestNamespace_InputTagHelper2 = CreateTagHelper<global::TestNamespace.InputTagHelper2>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("2000 + ");
|
||||
#line 8 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers.cshtml"
|
||||
Write(ViewBag.DefaultInterval);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" + 1");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("data-interval", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("text");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__TestNamespace_InputTagHelper.Type = __tagHelperStringValueBuffer;
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper.Type, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
__TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type;
|
||||
#line 8 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers.cshtml"
|
||||
__TestNamespace_InputTagHelper2.Checked = true;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("checked", __TestNamespace_InputTagHelper2.Checked, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n </script>\r\n");
|
||||
#line 10 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <script type=\"text/javascript\">\r\n var tag = \'<input checked=\"true\">\';\r\n </script>\r\n ");
|
||||
}
|
||||
);
|
||||
__TestNamespace_PTagHelper = CreateTagHelper<global::TestNamespace.PTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_PTagHelper);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("Hello World");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("class", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("1000");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("data-delay", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n </div>\r\n</script>");
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
@addTagHelper *, TestAssembly
|
||||
<span someattr>Hola</span>
|
||||
<div unbound="foo">
|
||||
<input value=Hello type='text' />
|
||||
</div>
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedTagHelpers.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "fc99ab53936074d66d80552f780e58d4edb223d6"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedTagHelpers_Runtime
|
||||
{
|
||||
#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 Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager(StartTagHelperWritingScope, EndTagHelperWritingScope);
|
||||
}
|
||||
return __backed__tagHelperScopeManager;
|
||||
}
|
||||
}
|
||||
private global::SpanTagHelper __SpanTagHelper = null;
|
||||
private global::DivTagHelper __DivTagHelper = null;
|
||||
private global::InputTagHelper __InputTagHelper = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("span", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagAndEndTag, "test", async() => {
|
||||
WriteLiteral("Hola");
|
||||
}
|
||||
);
|
||||
__SpanTagHelper = CreateTagHelper<global::SpanTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__SpanTagHelper);
|
||||
BeginWriteTagHelperAttribute();
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("someattr", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.Minimized);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagAndEndTag, "test", async() => {
|
||||
WriteLiteral("\r\n ");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.SelfClosing, "test", async() => {
|
||||
}
|
||||
);
|
||||
__InputTagHelper = CreateTagHelper<global::InputTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__InputTagHelper);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("Hello");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__InputTagHelper.FooProp = __tagHelperStringValueBuffer;
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("value", __InputTagHelper.FooProp, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("text");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("type", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.SingleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n");
|
||||
}
|
||||
);
|
||||
__DivTagHelper = CreateTagHelper<global::DivTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__DivTagHelper);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("foo");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("unbound", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
@addTagHelper something, nice
|
||||
|
||||
@{
|
||||
var literate = "or illiterate";
|
||||
var intDictionary = new Dictionary<string, int>
|
||||
{
|
||||
{ "three", 3 },
|
||||
};
|
||||
var stringDictionary = new SortedDictionary<string, string>
|
||||
{
|
||||
{ "name", "value" },
|
||||
};
|
||||
}
|
||||
|
||||
<div class="randomNonTagHelperAttribute">
|
||||
<input type="checkbox" int-dictionary="intDictionary" string-dictionary="stringDictionary"/>
|
||||
<input type="password" int-dictionary="intDictionary" int-prefix-garlic="37" int-prefix-grabber="42" />
|
||||
<input type="radio"
|
||||
int-prefix-grabber="42" int-prefix-salt="37" int-prefix-pepper="98" int-prefix-salt="8"
|
||||
string-prefix-grabber="string" string-prefix-paprika="another string"
|
||||
string-prefix-cumin="literate @literate?"/>
|
||||
<input int-prefix-value="37" string-prefix-thyme="string" />
|
||||
</div>
|
||||
|
|
@ -0,0 +1,241 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "5ae668a393146e4a06179eb37952603907a9b825"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_PrefixedAttributeTagHelpers_Runtime
|
||||
{
|
||||
#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 Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager(StartTagHelperWritingScope, EndTagHelperWritingScope);
|
||||
}
|
||||
return __backed__tagHelperScopeManager;
|
||||
}
|
||||
}
|
||||
private global::TestNamespace.InputTagHelper1 __TestNamespace_InputTagHelper1 = null;
|
||||
private global::TestNamespace.InputTagHelper2 __TestNamespace_InputTagHelper2 = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
WriteLiteral("\r\n");
|
||||
#line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml"
|
||||
|
||||
var literate = "or illiterate";
|
||||
var intDictionary = new Dictionary<string, int>
|
||||
{
|
||||
{ "three", 3 },
|
||||
};
|
||||
var stringDictionary = new SortedDictionary<string, string>
|
||||
{
|
||||
{ "name", "value" },
|
||||
};
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<div class=\"randomNonTagHelperAttribute\">\r\n ");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.SelfClosing, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_InputTagHelper1 = CreateTagHelper<global::TestNamespace.InputTagHelper1>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper1);
|
||||
__TestNamespace_InputTagHelper2 = CreateTagHelper<global::TestNamespace.InputTagHelper2>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("checkbox");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("type", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
#line 16 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml"
|
||||
__TestNamespace_InputTagHelper1.IntDictionaryProperty = intDictionary;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("int-dictionary", __TestNamespace_InputTagHelper1.IntDictionaryProperty, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
__TestNamespace_InputTagHelper2.IntDictionaryProperty = __TestNamespace_InputTagHelper1.IntDictionaryProperty;
|
||||
#line 16 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml"
|
||||
__TestNamespace_InputTagHelper1.StringDictionaryProperty = stringDictionary;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("string-dictionary", __TestNamespace_InputTagHelper1.StringDictionaryProperty, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
__TestNamespace_InputTagHelper2.StringDictionaryProperty = __TestNamespace_InputTagHelper1.StringDictionaryProperty;
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n ");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.SelfClosing, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_InputTagHelper1 = CreateTagHelper<global::TestNamespace.InputTagHelper1>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper1);
|
||||
__TestNamespace_InputTagHelper2 = CreateTagHelper<global::TestNamespace.InputTagHelper2>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("password");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("type", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
#line 17 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml"
|
||||
__TestNamespace_InputTagHelper1.IntDictionaryProperty = intDictionary;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("int-dictionary", __TestNamespace_InputTagHelper1.IntDictionaryProperty, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
__TestNamespace_InputTagHelper2.IntDictionaryProperty = __TestNamespace_InputTagHelper1.IntDictionaryProperty;
|
||||
if (__TestNamespace_InputTagHelper1.IntDictionaryProperty == null)
|
||||
{
|
||||
throw new InvalidOperationException(FormatInvalidIndexerAssignment("int-prefix-garlic", "TestNamespace.InputTagHelper1", "IntDictionaryProperty"));
|
||||
}
|
||||
#line 17 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml"
|
||||
__TestNamespace_InputTagHelper1.IntDictionaryProperty["garlic"] = 37;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("int-prefix-garlic", __TestNamespace_InputTagHelper1.IntDictionaryProperty["garlic"], global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
__TestNamespace_InputTagHelper2.IntDictionaryProperty["garlic"] = __TestNamespace_InputTagHelper1.IntDictionaryProperty["garlic"];
|
||||
#line 17 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml"
|
||||
__TestNamespace_InputTagHelper1.IntProperty = 42;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("int-prefix-grabber", __TestNamespace_InputTagHelper1.IntProperty, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
__TestNamespace_InputTagHelper2.IntDictionaryProperty["grabber"] = __TestNamespace_InputTagHelper1.IntProperty;
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n ");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.SelfClosing, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_InputTagHelper1 = CreateTagHelper<global::TestNamespace.InputTagHelper1>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper1);
|
||||
__TestNamespace_InputTagHelper2 = CreateTagHelper<global::TestNamespace.InputTagHelper2>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("radio");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("type", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
#line 19 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml"
|
||||
__TestNamespace_InputTagHelper1.IntProperty = 42;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("int-prefix-grabber", __TestNamespace_InputTagHelper1.IntProperty, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
if (__TestNamespace_InputTagHelper2.IntDictionaryProperty == null)
|
||||
{
|
||||
throw new InvalidOperationException(FormatInvalidIndexerAssignment("int-prefix-grabber", "TestNamespace.InputTagHelper2", "IntDictionaryProperty"));
|
||||
}
|
||||
__TestNamespace_InputTagHelper2.IntDictionaryProperty["grabber"] = __TestNamespace_InputTagHelper1.IntProperty;
|
||||
#line 19 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml"
|
||||
__TestNamespace_InputTagHelper1.IntDictionaryProperty["salt"] = 37;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("int-prefix-salt", __TestNamespace_InputTagHelper1.IntDictionaryProperty["salt"], global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
__TestNamespace_InputTagHelper2.IntDictionaryProperty["salt"] = __TestNamespace_InputTagHelper1.IntDictionaryProperty["salt"];
|
||||
#line 19 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml"
|
||||
__TestNamespace_InputTagHelper1.IntDictionaryProperty["pepper"] = 98;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("int-prefix-pepper", __TestNamespace_InputTagHelper1.IntDictionaryProperty["pepper"], global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
__TestNamespace_InputTagHelper2.IntDictionaryProperty["pepper"] = __TestNamespace_InputTagHelper1.IntDictionaryProperty["pepper"];
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("8");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("int-prefix-salt", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("string");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__TestNamespace_InputTagHelper1.StringProperty = __tagHelperStringValueBuffer;
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("string-prefix-grabber", __TestNamespace_InputTagHelper1.StringProperty, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
if (__TestNamespace_InputTagHelper2.StringDictionaryProperty == null)
|
||||
{
|
||||
throw new InvalidOperationException(FormatInvalidIndexerAssignment("string-prefix-grabber", "TestNamespace.InputTagHelper2", "StringDictionaryProperty"));
|
||||
}
|
||||
__TestNamespace_InputTagHelper2.StringDictionaryProperty["grabber"] = __TestNamespace_InputTagHelper1.StringProperty;
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("another string");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__TestNamespace_InputTagHelper1.StringDictionaryProperty["paprika"] = __tagHelperStringValueBuffer;
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("string-prefix-paprika", __TestNamespace_InputTagHelper1.StringDictionaryProperty["paprika"], global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
__TestNamespace_InputTagHelper2.StringDictionaryProperty["paprika"] = __TestNamespace_InputTagHelper1.StringDictionaryProperty["paprika"];
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("literate ");
|
||||
#line 21 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml"
|
||||
WriteLiteral(literate);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("?");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__TestNamespace_InputTagHelper1.StringDictionaryProperty["cumin"] = __tagHelperStringValueBuffer;
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("string-prefix-cumin", __TestNamespace_InputTagHelper1.StringDictionaryProperty["cumin"], global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
__TestNamespace_InputTagHelper2.StringDictionaryProperty["cumin"] = __TestNamespace_InputTagHelper1.StringDictionaryProperty["cumin"];
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n ");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.SelfClosing, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_InputTagHelper1 = CreateTagHelper<global::TestNamespace.InputTagHelper1>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper1);
|
||||
__TestNamespace_InputTagHelper2 = CreateTagHelper<global::TestNamespace.InputTagHelper2>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2);
|
||||
if (__TestNamespace_InputTagHelper1.IntDictionaryProperty == null)
|
||||
{
|
||||
throw new InvalidOperationException(FormatInvalidIndexerAssignment("int-prefix-value", "TestNamespace.InputTagHelper1", "IntDictionaryProperty"));
|
||||
}
|
||||
#line 22 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml"
|
||||
__TestNamespace_InputTagHelper1.IntDictionaryProperty["value"] = 37;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("int-prefix-value", __TestNamespace_InputTagHelper1.IntDictionaryProperty["value"], global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
__TestNamespace_InputTagHelper2.IntDictionaryProperty["value"] = __TestNamespace_InputTagHelper1.IntDictionaryProperty["value"];
|
||||
if (__TestNamespace_InputTagHelper1.StringDictionaryProperty == null)
|
||||
{
|
||||
throw new InvalidOperationException(FormatInvalidIndexerAssignment("string-prefix-thyme", "TestNamespace.InputTagHelper1", "StringDictionaryProperty"));
|
||||
}
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("string");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__TestNamespace_InputTagHelper1.StringDictionaryProperty["thyme"] = __tagHelperStringValueBuffer;
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("string-prefix-thyme", __TestNamespace_InputTagHelper1.StringDictionaryProperty["thyme"], global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
__TestNamespace_InputTagHelper2.StringDictionaryProperty["thyme"] = __TestNamespace_InputTagHelper1.StringDictionaryProperty["thyme"];
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n</div>");
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
@removeTagHelper something, nice
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
@addTagHelper *, TestAssembly
|
||||
<p>Hola</p>
|
||||
<form>
|
||||
<input value='Hello' type='text' />
|
||||
</form>
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleTagHelpers.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "248dc9c0c1ef35d3636cfb2fa7f5ac0f8a0b553a"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SimpleTagHelpers_Runtime
|
||||
{
|
||||
#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 Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager(StartTagHelperWritingScope, EndTagHelperWritingScope);
|
||||
}
|
||||
return __backed__tagHelperScopeManager;
|
||||
}
|
||||
}
|
||||
private global::InputTagHelper __InputTagHelper = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
WriteLiteral("<p>Hola</p>\r\n<form>\r\n ");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.SelfClosing, "test", async() => {
|
||||
}
|
||||
);
|
||||
__InputTagHelper = CreateTagHelper<global::InputTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__InputTagHelper);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("Hello");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__InputTagHelper.FooProp = __tagHelperStringValueBuffer;
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("value", __InputTagHelper.FooProp, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.SingleQuotes);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("text");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("type", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.SingleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n</form>");
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
@addTagHelper something, nice
|
||||
|
||||
<p class="Hello World" age="1337">Body of Tag</p>
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
@addTagHelper something, nice
|
||||
|
||||
<p
|
||||
class="Hello World" age="1337">Body of Tag</p>
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "83a2d9976b209020f80917aa61a3338e37d3c446"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SingleTagHelperWithNewlineBeforeAttributes_Runtime
|
||||
{
|
||||
#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 Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager(StartTagHelperWritingScope, EndTagHelperWritingScope);
|
||||
}
|
||||
return __backed__tagHelperScopeManager;
|
||||
}
|
||||
}
|
||||
private global::TestNamespace.PTagHelper __TestNamespace_PTagHelper = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
WriteLiteral("\r\n");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagAndEndTag, "test", async() => {
|
||||
WriteLiteral("Body of Tag");
|
||||
}
|
||||
);
|
||||
__TestNamespace_PTagHelper = CreateTagHelper<global::TestNamespace.PTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_PTagHelper);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("Hello World");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("class", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
#line 4 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes.cshtml"
|
||||
__TestNamespace_PTagHelper.Age = 1337;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("age", __TestNamespace_PTagHelper.Age, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "4d7ff17da750ffcbca3130faffef1030e5eb03b8"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SingleTagHelper_Runtime
|
||||
{
|
||||
#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 Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager(StartTagHelperWritingScope, EndTagHelperWritingScope);
|
||||
}
|
||||
return __backed__tagHelperScopeManager;
|
||||
}
|
||||
}
|
||||
private global::TestNamespace.PTagHelper __TestNamespace_PTagHelper = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
WriteLiteral("\r\n");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagAndEndTag, "test", async() => {
|
||||
WriteLiteral("Body of Tag");
|
||||
}
|
||||
);
|
||||
__TestNamespace_PTagHelper = CreateTagHelper<global::TestNamespace.PTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_PTagHelper);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("Hello World");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("class", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
#line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper.cshtml"
|
||||
__TestNamespace_PTagHelper.Age = 1337;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("age", __TestNamespace_PTagHelper.Age, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
@addTagHelper *, nice
|
||||
|
||||
<ul [item]="items"></ul>
|
||||
<ul [(item)]="items"></ul>
|
||||
<button (click)="doSomething()">Click Me</button>
|
||||
<button (^click)="doSomething()">Click Me</button>
|
||||
<template *something="value">
|
||||
</template>
|
||||
<div #local></div>
|
||||
<div #local="value"></div>
|
||||
|
||||
<ul bound [item]="items" [item]="items"></ul>
|
||||
<ul bound [(item)]="items" [(item)]="items"></ul>
|
||||
<button bound (click)="doSomething()" (click)="doSomething()">Click Me</button>
|
||||
<button bound (^click)="doSomething()" (^click)="doSomething()">Click Me</button>
|
||||
<template bound *something="value" *something="value">
|
||||
</template>
|
||||
<div bound #localminimized></div>
|
||||
<div bound #local="value" #local="value"></div>
|
||||
|
|
@ -0,0 +1,210 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "85cdc137d6a8c95fa926441de44d5187d5c8051e"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SymbolBoundAttributes_Runtime
|
||||
{
|
||||
#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 Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager(StartTagHelperWritingScope, EndTagHelperWritingScope);
|
||||
}
|
||||
return __backed__tagHelperScopeManager;
|
||||
}
|
||||
}
|
||||
private global::TestNamespace.CatchAllTagHelper __TestNamespace_CatchAllTagHelper = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
WriteLiteral("\r\n<ul [item]=\"items\"></ul>\r\n<ul [(item)]=\"items\"></ul>\r\n<button (click)=\"doSomething()\">Click Me</button>\r\n<button (^click)=\"doSomething()\">Click Me</button>\r\n<template *something=\"value\">\r\n</template>\r\n<div #local></div>\r\n<div #local=\"value\"></div>\r\n\r\n");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("ul", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagAndEndTag, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_CatchAllTagHelper = CreateTagHelper<global::TestNamespace.CatchAllTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_CatchAllTagHelper);
|
||||
BeginWriteTagHelperAttribute();
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("bound", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.Minimized);
|
||||
#line 12 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes.cshtml"
|
||||
__TestNamespace_CatchAllTagHelper.ListItems = items;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("[item]", __TestNamespace_CatchAllTagHelper.ListItems, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("items");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("[item]", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("ul", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagAndEndTag, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_CatchAllTagHelper = CreateTagHelper<global::TestNamespace.CatchAllTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_CatchAllTagHelper);
|
||||
BeginWriteTagHelperAttribute();
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("bound", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.Minimized);
|
||||
#line 13 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes.cshtml"
|
||||
__TestNamespace_CatchAllTagHelper.ArrayItems = items;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("[(item)]", __TestNamespace_CatchAllTagHelper.ArrayItems, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("items");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("[(item)]", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("button", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagAndEndTag, "test", async() => {
|
||||
WriteLiteral("Click Me");
|
||||
}
|
||||
);
|
||||
__TestNamespace_CatchAllTagHelper = CreateTagHelper<global::TestNamespace.CatchAllTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_CatchAllTagHelper);
|
||||
BeginWriteTagHelperAttribute();
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("bound", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.Minimized);
|
||||
#line 14 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes.cshtml"
|
||||
__TestNamespace_CatchAllTagHelper.Event1 = doSomething();
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("(click)", __TestNamespace_CatchAllTagHelper.Event1, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("doSomething()");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("(click)", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("button", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagAndEndTag, "test", async() => {
|
||||
WriteLiteral("Click Me");
|
||||
}
|
||||
);
|
||||
__TestNamespace_CatchAllTagHelper = CreateTagHelper<global::TestNamespace.CatchAllTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_CatchAllTagHelper);
|
||||
BeginWriteTagHelperAttribute();
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("bound", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.Minimized);
|
||||
#line 15 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes.cshtml"
|
||||
__TestNamespace_CatchAllTagHelper.Event2 = doSomething();
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("(^click)", __TestNamespace_CatchAllTagHelper.Event2, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("doSomething()");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("(^click)", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("template", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagAndEndTag, "test", async() => {
|
||||
WriteLiteral("\r\n");
|
||||
}
|
||||
);
|
||||
__TestNamespace_CatchAllTagHelper = CreateTagHelper<global::TestNamespace.CatchAllTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_CatchAllTagHelper);
|
||||
BeginWriteTagHelperAttribute();
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("bound", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.Minimized);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("value");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__TestNamespace_CatchAllTagHelper.StringProperty1 = __tagHelperStringValueBuffer;
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("*something", __TestNamespace_CatchAllTagHelper.StringProperty1, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("value");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("*something", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagAndEndTag, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_CatchAllTagHelper = CreateTagHelper<global::TestNamespace.CatchAllTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_CatchAllTagHelper);
|
||||
BeginWriteTagHelperAttribute();
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("bound", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.Minimized);
|
||||
BeginWriteTagHelperAttribute();
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("#localminimized", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.Minimized);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagAndEndTag, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_CatchAllTagHelper = CreateTagHelper<global::TestNamespace.CatchAllTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_CatchAllTagHelper);
|
||||
BeginWriteTagHelperAttribute();
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("bound", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.Minimized);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("value");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__TestNamespace_CatchAllTagHelper.StringProperty2 = __tagHelperStringValueBuffer;
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("#local", __TestNamespace_CatchAllTagHelper.StringProperty2, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("value");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("#local", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
@addTagHelper something, nice
|
||||
|
||||
@{
|
||||
var code = "some code";
|
||||
}
|
||||
|
||||
@section MySection {
|
||||
<div>
|
||||
<mytaghelper boundproperty="Current Time: @DateTime.Now" unboundproperty="Current Time: @DateTime.Now">
|
||||
In None ContentBehavior.
|
||||
<nestedtaghelper>Some buffered values with @code</nestedtaghelper>
|
||||
</mytaghelper>
|
||||
</div>
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
@addTagHelper *, TestAssembly
|
||||
<form>
|
||||
<input bound=@Hello type='text' />
|
||||
</form>
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "f7ed8b06f7ede1d7928dc05f2b2f081a3fda13aa"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithBoundAttributes_Runtime
|
||||
{
|
||||
#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 Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager(StartTagHelperWritingScope, EndTagHelperWritingScope);
|
||||
}
|
||||
return __backed__tagHelperScopeManager;
|
||||
}
|
||||
}
|
||||
private global::InputTagHelper __InputTagHelper = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
WriteLiteral("<form>\r\n ");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.SelfClosing, "test", async() => {
|
||||
}
|
||||
);
|
||||
__InputTagHelper = CreateTagHelper<global::InputTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__InputTagHelper);
|
||||
BeginAddHtmlAttributeValues(__tagHelperExecutionContext, "bound", 1, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
#line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes.cshtml"
|
||||
AddHtmlAttributeValue("", 56, Hello, 56, 6, false);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
EndAddHtmlAttributeValues(__tagHelperExecutionContext);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("text");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("type", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.SingleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n</form>");
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
@addTagHelper something, nice
|
||||
|
||||
<p
|
||||
class
|
||||
=
|
||||
"Hello World" age =1337
|
||||
data-content= "@true">Body of Tag</p>
|
||||
|
||||
<input type = 'text' data-content= "hello" />
|
||||
|
||||
<p age= "1234" data-content
|
||||
= 'hello2'></p>
|
||||
|
||||
<input type
|
||||
=password data-content =blah/>
|
||||
|
|
@ -0,0 +1,141 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "44db1fa170a6845ec719f4200e4bb1f639830b49"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithWeirdlySpacedAttributes_Runtime
|
||||
{
|
||||
#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 Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager(StartTagHelperWritingScope, EndTagHelperWritingScope);
|
||||
}
|
||||
return __backed__tagHelperScopeManager;
|
||||
}
|
||||
}
|
||||
private global::TestNamespace.PTagHelper __TestNamespace_PTagHelper = null;
|
||||
private global::TestNamespace.InputTagHelper __TestNamespace_InputTagHelper = null;
|
||||
private global::TestNamespace.InputTagHelper2 __TestNamespace_InputTagHelper2 = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
WriteLiteral("\r\n");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagAndEndTag, "test", async() => {
|
||||
WriteLiteral("Body of Tag");
|
||||
}
|
||||
);
|
||||
__TestNamespace_PTagHelper = CreateTagHelper<global::TestNamespace.PTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_PTagHelper);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("Hello World");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("class", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
#line 6 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes.cshtml"
|
||||
__TestNamespace_PTagHelper.Age = 1337;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("age", __TestNamespace_PTagHelper.Age, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
BeginWriteTagHelperAttribute();
|
||||
#line 7 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes.cshtml"
|
||||
Write(true);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("data-content", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n\r\n");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.SelfClosing, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_InputTagHelper = CreateTagHelper<global::TestNamespace.InputTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper);
|
||||
__TestNamespace_InputTagHelper2 = CreateTagHelper<global::TestNamespace.InputTagHelper2>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("text");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__TestNamespace_InputTagHelper.Type = __tagHelperStringValueBuffer;
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper.Type, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.SingleQuotes);
|
||||
__TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type;
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("hello");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("data-content", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n\r\n");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagAndEndTag, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_PTagHelper = CreateTagHelper<global::TestNamespace.PTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_PTagHelper);
|
||||
#line 11 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes.cshtml"
|
||||
__TestNamespace_PTagHelper.Age = 1234;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("age", __TestNamespace_PTagHelper.Age, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("hello2");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("data-content", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.SingleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n\r\n");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.SelfClosing, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_InputTagHelper = CreateTagHelper<global::TestNamespace.InputTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper);
|
||||
__TestNamespace_InputTagHelper2 = CreateTagHelper<global::TestNamespace.InputTagHelper2>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_InputTagHelper2);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("password");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__TestNamespace_InputTagHelper.Type = __tagHelperStringValueBuffer;
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper.Type, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
__TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type;
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("blah");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("data-content", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
@addTagHelper something, nice
|
||||
@{
|
||||
var @class = "container-fluid";
|
||||
var @int = 1;
|
||||
}
|
||||
|
||||
<p class="@class" age="1337">Body of Tag</p>
|
||||
<p class="@(@class)" age="42"></p>
|
||||
<p class="test" age="42 + @int"></p>
|
||||
<p class="test" age="@int"></p>
|
||||
<p class="test" age="@(@int)"></p>
|
||||
<p class="custom-@(@class)" age="4 * @(@int + 2)"></p>
|
||||
|
|
@ -0,0 +1,190 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "b9b5a5baa9e2ea89cb37a127c0623b083bff74c3"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TransitionsInTagHelperAttributes_Runtime
|
||||
{
|
||||
#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 Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager(StartTagHelperWritingScope, EndTagHelperWritingScope);
|
||||
}
|
||||
return __backed__tagHelperScopeManager;
|
||||
}
|
||||
}
|
||||
private global::TestNamespace.PTagHelper __TestNamespace_PTagHelper = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
#line 2 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml"
|
||||
|
||||
var @class = "container-fluid";
|
||||
var @int = 1;
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagAndEndTag, "test", async() => {
|
||||
WriteLiteral("Body of Tag");
|
||||
}
|
||||
);
|
||||
__TestNamespace_PTagHelper = CreateTagHelper<global::TestNamespace.PTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_PTagHelper);
|
||||
BeginAddHtmlAttributeValues(__tagHelperExecutionContext, "class", 1, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
AddHtmlAttributeValue("", 107, new HelperResult(async(__razor_attribute_value_writer) => {
|
||||
}
|
||||
), 107, 6, false);
|
||||
EndAddHtmlAttributeValues(__tagHelperExecutionContext);
|
||||
#line 7 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml"
|
||||
__TestNamespace_PTagHelper.Age = 1337;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("age", __TestNamespace_PTagHelper.Age, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagAndEndTag, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_PTagHelper = CreateTagHelper<global::TestNamespace.PTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_PTagHelper);
|
||||
BeginAddHtmlAttributeValues(__tagHelperExecutionContext, "class", 1, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
#line 8 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml"
|
||||
AddHtmlAttributeValue("", 153, @class, 153, 9, false);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
EndAddHtmlAttributeValues(__tagHelperExecutionContext);
|
||||
#line 8 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml"
|
||||
__TestNamespace_PTagHelper.Age = 42;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("age", __TestNamespace_PTagHelper.Age, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagAndEndTag, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_PTagHelper = CreateTagHelper<global::TestNamespace.PTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_PTagHelper);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("test");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("class", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
#line 9 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml"
|
||||
__TestNamespace_PTagHelper.Age = 42 + @int;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("age", __TestNamespace_PTagHelper.Age, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagAndEndTag, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_PTagHelper = CreateTagHelper<global::TestNamespace.PTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_PTagHelper);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("test");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("class", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
#line 10 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml"
|
||||
__TestNamespace_PTagHelper.Age = int;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("age", __TestNamespace_PTagHelper.Age, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagAndEndTag, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_PTagHelper = CreateTagHelper<global::TestNamespace.PTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_PTagHelper);
|
||||
BeginWriteTagHelperAttribute();
|
||||
WriteLiteral("test");
|
||||
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
|
||||
__tagHelperExecutionContext.AddHtmlAttribute("class", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
#line 11 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml"
|
||||
__TestNamespace_PTagHelper.Age = (@int);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("age", __TestNamespace_PTagHelper.Age, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n");
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.Evolution.Legacy.TagMode.StartTagAndEndTag, "test", async() => {
|
||||
}
|
||||
);
|
||||
__TestNamespace_PTagHelper = CreateTagHelper<global::TestNamespace.PTagHelper>();
|
||||
__tagHelperExecutionContext.Add(__TestNamespace_PTagHelper);
|
||||
BeginAddHtmlAttributeValues(__tagHelperExecutionContext, "class", 2, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
AddHtmlAttributeValue("", 296, "custom-", 296, 7, true);
|
||||
#line 12 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml"
|
||||
AddHtmlAttributeValue("", 303, @class, 303, 9, false);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
EndAddHtmlAttributeValues(__tagHelperExecutionContext);
|
||||
#line 12 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml"
|
||||
__TestNamespace_PTagHelper.Age = 4 * @(@int + 2);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
__tagHelperExecutionContext.AddTagHelperAttribute("age", __TestNamespace_PTagHelper.Age, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes);
|
||||
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
|
||||
if (!__tagHelperExecutionContext.Output.IsContentModified)
|
||||
{
|
||||
await __tagHelperExecutionContext.SetOutputContentAsync();
|
||||
}
|
||||
Write(__tagHelperExecutionContext.Output);
|
||||
__tagHelperExecutionContext = __tagHelperScopeManager.End();
|
||||
WriteLiteral("\r\n");
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -19,7 +19,7 @@ Document -
|
|||
TagHelper -
|
||||
InitializeTagHelperStructure - - input - TagMode.SelfClosing
|
||||
CreateTagHelper - - InputTagHelper
|
||||
SetTagHelperProperty - - value - FooProp - HtmlAttributeValueStyle.DoubleQuotes
|
||||
SetTagHelperProperty - (92:3,17 [5] NestedTagHelpers.cshtml) - value - FooProp - HtmlAttributeValueStyle.DoubleQuotes
|
||||
HtmlContent - (92:3,17 [5] NestedTagHelpers.cshtml) - Hello
|
||||
AddTagHelperHtmlAttribute - - type - HtmlAttributeValueStyle.SingleQuotes
|
||||
HtmlContent - (104:3,29 [4] NestedTagHelpers.cshtml) - text
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ Document -
|
|||
TagHelper -
|
||||
InitializeTagHelperStructure - - input - TagMode.SelfClosing
|
||||
CreateTagHelper - - InputTagHelper
|
||||
SetTagHelperProperty - - bound - FooProp - HtmlAttributeValueStyle.DoubleQuotes
|
||||
SetTagHelperProperty - (56:2,17 [6] TagHelpersWithBoundAttributes.cshtml) - bound - FooProp - HtmlAttributeValueStyle.DoubleQuotes
|
||||
CSharpExpression - (57:2,18 [5] TagHelpersWithBoundAttributes.cshtml)
|
||||
CSharpToken - (57:2,18 [5] TagHelpersWithBoundAttributes.cshtml) - Hello
|
||||
AddTagHelperHtmlAttribute - - type - HtmlAttributeValueStyle.SingleQuotes
|
||||
|
|
|
|||
Loading…
Reference in New Issue