TemplateBlock Class

Represents a block in a template.

public abstract class TemplateBlock

Constructors

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

TemplateBlock(Template, string, int)

TemplateBlock.cs

Initializes a new instance of the TemplateBlock class.

protected TemplateBlock(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.

Properties

NameDescription
EndGets the position where the block ends in the source template.
IndexGets the index of this block in the template.
SpanGets or sets the source span of the block in the source template.
StartGets the position where the block starts in the source template.
TemplateGets the template that contains this block.
TextGets the text content of the block.

Gets the position where the block ends in the source template.

public TextPosition End { get; }

Property value

TextPosition

Gets the index of this block in the template.

public int Index { get; }

Property value

int

Gets or sets the source span of the block in the source template.

public TextSpan Span { get; }

Property value

TextSpan

Gets the position where the block starts in the source template.

public TextPosition Start { get; }

Property value

TextPosition

Gets the template that contains this block.

public Template Template { get; }

Property value

Template

Gets the text content of the block.

public string Text { get; }

Property value

string

Methods

NameDescription
BuildCode()Builds the C# code for this block.
EscapeVerbatimString(string?)

BuildCode()

Builds the C# code for this block.

public abstract string BuildCode()

Returns

string The generated C# code.

EscapeVerbatimString(string?)

TemplateBlock.cs
protected static string? EscapeVerbatimString(string? s)

Parameters

s string?

Returns

string?

No documentation is available.