Skip to content

AnsiWriter Class

Writes a Document to a ICellSurface.

C#
public class AnsiWriter

Inheritance object

Creates a new instance with the source document and target surface.

C#
public AnsiWriter(Document ansiDocument, ICellSurface editor)

ansiDocument Document
The source document containing ANSI commands.

editor ICellSurface
The surface to parse the ANSI to.

The document used to create this writer.

C#
public Document AnsiDocument { get; }

The blink effect to apply when the ansi document provides the ANSI blink command.

C#
public ICellEffect BlinkEffect { get; set; }

The cursor used to write to the target ICellSurface.

C#
public Cursor Cursor { get; }

How many characters to process a second. When set to 0 reads the entire document at once.

C#
public int CharactersPerSecond { get; set; }

Processes the document by the amount of time that has elapsed. If CharactersPerSecond is 0, time elapsed has no affect.

C#
public void Process(double timeElapsed)

timeElapsed double
The time in seconds.

Interprets an individual ansi code.

C#
public void AnsiInterpret(string code)

code string
The ANSI.SYS code to read.

Reads a line of ANSI.SYS code.

C#
public bool AnsiReadLine(string line, bool moreLines = false)

line string
The line to read.

moreLines bool
When true, calls LineFeed(); otherwise does nothing.

bool
Returns false when character 26 is encountered; otherwise true.

Loads an ansi file and parses it.

C#
public void ReadEntireDocument()

Moves the reader back to the start of the file so that the source can .

C#
public void Restart()