Skip to content
ConsoleMonster

API Reference

Class

WriterTarget

Namespace ConsoleMonster.Output
Assembly ConsoleMonster
Implements
Modifiers sealed

Output to a TextWriter (a log, a StringWriter, a host's output stream) laid out for a chosen width, glyph tier and colour depth: append-only lines, with SGR colour codes only when the depth asks for them. No input.

Inheritance

  • Object
  • WriterTarget

Constructors

WriterTarget 2 overloads
public WriterTarget(TextWriter writer, Int32 width = 80, GlyphTier glyphs = Ascii, ColorDepth colors = None, CultureInfo? culture = null) #

Creates a writer target.

Parameters

writer System.IO.TextWriter requiredposition: 0
The writer; the caller keeps ownership.
width System.Int32 = 80 optionalposition: 1
Width in cells (default 80).
glyphs ConsoleMonster.Capabilities.GlyphTier = Ascii optionalposition: 2
The glyph tier (default ASCII, safe in any log).
colors ConsoleMonster.Capabilities.ColorDepth = None optionalposition: 3
The colour depth (default none: plain text).
culture System.Globalization.CultureInfo? = null optionalposition: 4
The culture for numbers, dates and built-in labels; null for the current culture.
public WriterTarget(TextWriter writer, TerminalProfile profile) #

Creates a writer target with an explicit profile (its mode decides between line output and VT output).

Parameters

writer System.IO.TextWriter requiredposition: 0
The writer; the caller keeps ownership.
profile ConsoleMonster.Capabilities.TerminalProfile requiredposition: 1
The profile.

Properties

public String Name { get; } #

A short description for diagnostics, for example console or recording 80x24.

public TerminalProfile Profile { get; } #

The capability profile for a write happening now (the console's refreshes its size on every call).

public ITheme? Theme { get; set; } #

The theme (default the dark theme, so output does not depend on the machine).

public ITerminalWriter? Writer { get; } #

The writer that receives the output, or null for the process console. The target owns it: callers write and flush but never dispose it.

public IInputSource? Input { get; } #

The input for prompts, menus and forms, or null. On the console null means the keyboard; on any other target it means nobody can answer, so prompts use their defaults or explain what is missing.