TagHelperAttributeValueCodeRenderer Class¶
Renders code for tag helper property initialization.
- Namespace
Microsoft.AspNetCore.Razor.CodeGenerators
- Assemblies
- Microsoft.AspNetCore.Razor
Syntax¶
public class TagHelperAttributeValueCodeRenderer
-
class
Microsoft.AspNetCore.Razor.CodeGenerators.
TagHelperAttributeValueCodeRenderer
Methods¶
-
RenderAttributeValue
(Microsoft.AspNetCore.Razor.Compilation.TagHelpers.TagHelperAttributeDescriptor, Microsoft.AspNetCore.Razor.CodeGenerators.CSharpCodeWriter, Microsoft.AspNetCore.Razor.CodeGenerators.CodeGeneratorContext, System.Action<Microsoft.AspNetCore.Razor.CodeGenerators.CSharpCodeWriter>, System.Boolean)¶ Called during Razor’s code generation process to generate code that instantiates the value of the tag helper’s property. Last value written should not be or end with a semicolon.
Arguments: - attributeDescriptor (Microsoft.AspNetCore.Razor.Compilation.TagHelpers.TagHelperAttributeDescriptor) – The
Microsoft.AspNetCore.Razor.Compilation.TagHelpers.TagHelperAttributeDescriptor
to generate code for. - writer (Microsoft.AspNetCore.Razor.CodeGenerators.CSharpCodeWriter) – The
Microsoft.AspNetCore.Razor.CodeGenerators.CSharpCodeWriter
that’s used to write code. - context (Microsoft.AspNetCore.Razor.CodeGenerators.CodeGeneratorContext) – A
Microsoft.AspNetCore.Razor.Chunks.Generators.ChunkGeneratorContext
instance that contains information about the current code generation process. - renderAttributeValue (System.Action<Microsoft.AspNetCore.Razor.CodeGenerators.CSharpCodeWriter>) –
System.Action
that renders the raw value of the HTML attribute. - complexValue (System.Boolean) – Indicates whether or not the source attribute value contains more than simple text. <code>false</code> for plain C# expressions e.g. <code>”PropertyName”</code>. <code>true</code> if the attribute value contain at least one in-line Razor construct e.g. <code>”@(@readonly)”</code>.
public virtual void RenderAttributeValue(TagHelperAttributeDescriptor attributeDescriptor, CSharpCodeWriter writer, CodeGeneratorContext context, Action<CSharpCodeWriter> renderAttributeValue, bool complexValue)
- attributeDescriptor (Microsoft.AspNetCore.Razor.Compilation.TagHelpers.TagHelperAttributeDescriptor) – The
-