Example #1
0
        protected override void Visit(LiteralChunk chunk)
        {
            if (Context.Host.DesignTimeMode || string.IsNullOrEmpty(chunk.Text))
            {
                // Skip generating the chunk if we're in design time or if the chunk is empty.
                return;
            }

            if (Context.Host.EnableInstrumentation)
            {
                Writer.WriteStartInstrumentationContext(Context, chunk.Association, isLiteral: true);
            }

            if (Context.ExpressionRenderingMode == ExpressionRenderingMode.WriteToOutput)
            {
                RenderPreWriteStart();
            }

            Writer.WriteStringLiteral(chunk.Text);

            if (Context.ExpressionRenderingMode == ExpressionRenderingMode.WriteToOutput)
            {
                Writer.WriteEndMethodInvocation();
            }

            if (Context.Host.EnableInstrumentation)
            {
                Writer.WriteEndInstrumentationContext(Context);
            }
        }
Example #2
0
        protected override void Visit(LiteralChunk chunk)
        {
            if (!Context.Host.DesignTimeMode && String.IsNullOrEmpty(chunk.Text))
            {
                return;
            }

            // TODO: Add instrumentation

            if (!String.IsNullOrEmpty(chunk.Text) && !Context.Host.DesignTimeMode)
            {
                if (!String.IsNullOrEmpty(Context.TargetWriterName))
                {
                    Writer.WriteStartMethodInvocation(Context.Host.GeneratedClassContext.WriteLiteralToMethodName)
                    .Write(Context.TargetWriterName)
                    .WriteParameterSeparator();
                }
                else
                {
                    Writer.WriteStartMethodInvocation(Context.Host.GeneratedClassContext.WriteLiteralMethodName);
                }

                Writer.WriteStringLiteral(chunk.Text)
                .WriteEndMethodInvocation();
            }

            // TODO: Add instrumentation
        }
Example #3
0
        protected override void Visit(LiteralChunk chunk)
        {
            if (string.IsNullOrEmpty(chunk.Text))
            {
                return;
            }

            var renderHtml = new RenderHtml
            {
                Html             = chunk.Text,
                DocumentLocation = CreateMappingLocation(chunk.Start, chunk.Association.Length),
            };

            _context.Builder.Add(renderHtml);
        }
Example #4
0
        protected override void Visit(LiteralChunk chunk)
        {
            if (Context.Host.DesignTimeMode || string.IsNullOrEmpty(chunk.Text))
            {
                // Skip generating the chunk if we're in design time or if the chunk is empty.
                return;
            }

            if (Context.Host.EnableInstrumentation)
            {
                Writer.WriteStartInstrumentationContext(Context, chunk.Association, isLiteral: true);
            }

            RenderStartWriteLiteral(chunk.Text);

            if (Context.Host.EnableInstrumentation)
            {
                Writer.WriteEndInstrumentationContext(Context);
            }
        }
 protected override void Visit(LiteralChunk chunk)
 {
 }
Example #6
0
 /// <summary>
 /// Writes code for the given <paramref name="chunk"/>.
 /// </summary>
 /// <param name="chunk">The <see cref="LiteralChunk"/> to render.</param>
 protected override void Visit(LiteralChunk chunk)
 {
     RenderCode(chunk.Text, (Span)chunk.Association);
 }
 protected virtual void Visit(LiteralChunk chunk)
 {
 }
 protected abstract void Visit(LiteralChunk chunk);
 /// <summary>
 /// Writes code for the given <paramref name="chunk"/>.
 /// </summary>
 /// <param name="chunk">The <see cref="LiteralChunk"/> to render.</param>
 protected override void Visit(LiteralChunk chunk)
 {
     RenderCode(chunk.Text, chunk.Start);
 }