TextBlock Class

Represents a text block in a template that will be written to the output.

public class TextBlock : TemplateBlock
Inheritance
TemplateBlock TextBlock

Constructors

NameDescription
TextBlock(Template, string, int)Initializes a new instance of the TextBlock class.

TextBlock(Template, string, int)

TextBlock.cs

Initializes a new instance of the TextBlock class.

public TextBlock(Template template, string text, int index)

Parameters

template Template
The template that contains this block.
text string
The text content of the block.
index int
The index of this block in the template.

Methods

NameDescription
BuildCode()Builds the C# code for this text block.

BuildCode()

TextBlock.cs

Builds the C# code for this text block.

public override string BuildCode()

Returns

string The generated C# code that writes the text to the output.