public CSharpTagHelperFieldDeclarationVisitor([NotNull] CSharpCodeWriter writer,
                                               [NotNull] CodeBuilderContext context)
     : base(writer, context)
 {
     _declaredTagHelpers = new HashSet <string>(StringComparer.Ordinal);
     _tagHelperContext   = Context.Host.GeneratedClassContext.GeneratedTagHelperContext;
 }
 /// <summary>
 /// Instantiates a new <see cref="CSharpTagHelperCodeRenderer"/>.
 /// </summary>
 /// <param name="bodyVisitor">The <see cref="IChunkVisitor"/> used to render chunks found in the body.</param>
 /// <param name="writer">The <see cref="CSharpCodeWriter"/> used to write code.</param>
 /// <param name="context">A <see cref="CodeBuilderContext"/> instance that contains information about
 /// the current code generation process.</param>
 public CSharpTagHelperCodeRenderer([NotNull] IChunkVisitor bodyVisitor,
                                    [NotNull] CSharpCodeWriter writer,
                                    [NotNull] CodeBuilderContext context)
 {
     _bodyVisitor               = bodyVisitor;
     _writer                    = writer;
     _context                   = context;
     _tagHelperContext          = context.Host.GeneratedClassContext.GeneratedTagHelperContext;
     AttributeValueCodeRenderer = new TagHelperAttributeValueCodeRenderer();
 }
        /// <summary>
        /// Instantiates a new <see cref="CSharpTagHelperCodeRenderer"/>.
        /// </summary>
        /// <param name="bodyVisitor">The <see cref="IChunkVisitor"/> used to render chunks found in the body.</param>
        /// <param name="writer">The <see cref="CSharpCodeWriter"/> used to write code.</param>
        /// <param name="context">A <see cref="CodeBuilderContext"/> instance that contains information about
        /// the current code generation process.</param>
        public CSharpTagHelperCodeRenderer(
            [NotNull] IChunkVisitor bodyVisitor,
            [NotNull] CSharpCodeWriter writer,
            [NotNull] CodeBuilderContext context)
        {
            _bodyVisitor      = bodyVisitor;
            _writer           = writer;
            _context          = context;
            _tagHelperContext = context.Host.GeneratedClassContext.GeneratedTagHelperContext;
            _designTimeMode   = context.Host.DesignTimeMode;

            _literalBodyVisitor        = new CSharpLiteralCodeVisitor(this, writer, context);
            AttributeValueCodeRenderer = new TagHelperAttributeValueCodeRenderer();
        }
Example #4
0
        /// <summary>
        /// Creates a new instance of <see cref="CSharpTagHelperRunnerInitializationVisitor"/>.
        /// </summary>
        /// <param name="writer">The <see cref="CSharpCodeWriter"/> used to generate code.</param>
        /// <param name="context">The <see cref="CodeGeneratorContext"/>.</param>
        public CSharpTagHelperRunnerInitializationVisitor(CSharpCodeWriter writer,
                                                          CodeGeneratorContext context)
            : base(writer, context)
        {
            if (writer == null)
            {
                throw new ArgumentNullException(nameof(writer));
            }

            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            _tagHelperContext = Context.Host.GeneratedClassContext.GeneratedTagHelperContext;
        }
Example #5
0
        public CSharpTagHelperFieldDeclarationVisitor(CSharpCodeWriter writer,
                                                      CodeGeneratorContext context)
            : base(writer, context)
        {
            if (writer == null)
            {
                throw new ArgumentNullException(nameof(writer));
            }

            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            _declaredTagHelpers = new HashSet <string>(StringComparer.Ordinal);
            _tagHelperContext   = Context.Host.GeneratedClassContext.GeneratedTagHelperContext;
        }
 /// <summary>
 /// Creates a new instance of <see cref="CSharpTagHelperRunnerInitializationVisitor"/>.
 /// </summary>
 /// <param name="writer">The <see cref="CSharpCodeWriter"/> used to generate code.</param>
 /// <param name="context">The <see cref="CodeBuilderContext"/>.</param>
 public CSharpTagHelperRunnerInitializationVisitor([NotNull] CSharpCodeWriter writer,
                                                   [NotNull] CodeBuilderContext context)
     : base(writer, context)
 {
     _tagHelperContext = Context.Host.GeneratedClassContext.GeneratedTagHelperContext;
 }