CodeBlock Class

Represents a block of executable code in a template.

public class CodeBlock : TemplateBlock
Inheritance
TemplateBlock CodeBlock

Constructors

NameDescription
CodeBlock(Template, string, int, bool)Represents a block of executable code in a template.

CodeBlock(Template, string, int, bool)

CodeBlock.cs

Represents a block of executable code in a template.

public CodeBlock(Template template, string text, int index, bool isExpression = false)

Parameters

template Template
text string
index int
isExpression bool

Properties

NameDescription
IsExpressionGets a value indicating whether this block is an evaluation expression.

IsExpression

CodeBlock.cs

Gets a value indicating whether this block is an evaluation expression.

public bool IsExpression { get; }

Property value

bool

Methods

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

BuildCode()

CodeBlock.cs

Builds the C# code for this code block.

public override string BuildCode()

Returns

string The generated C# code.