Skip to content
ConsoleMonster

API Reference

Class

InlineArea

Namespace ConsoleMonster.Live
Assembly ConsoleMonster
Implements
IDisposable
Modifiers sealed

A few lines below the cursor, drawn on demand on the calling thread (no render thread), on a console that other code writes to at the same time, such as PowerShell's warnings or Write-Host. Before each draw the area checks the console buffer for its own lines: when nothing was written after them they are redrawn in place; when other output came after them, the old lines are deleted (the output below moves up) and the area is drawn again under that output, so nothing is overwritten and no stale copy stays behind. InlineArea.Clear removes the area the same way. It needs a Windows console whose buffer can be read (Windows Terminal, conhost); see InlineArea.IsSupported. Enable-ConsoleFormatting -Feature Progress draws Write-Progress with it.

Inheritance

  • Object
  • InlineArea

Constructors

public InlineArea(TerminalProfile? profile = null) #

Creates an area on the current console.

Parameters

profile ConsoleMonster.Capabilities.TerminalProfile? = null optionalposition: 0
The terminal profile, or null for the current one.

Methods

public Void Abandon() #
Returns: Void

Forgets the area without touching the screen (it stays as printed text).

public Void Clear() #
Returns: Void

Removes the area; later output starts where it was (or, after other output, where that output ended).

public Void Dispose() #
Returns: Void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Draw 2 overloads
public Void Draw(IWidget widget, RenderContext? context = null) #
Returns: Void

Draws a widget as the area's new content, as tall as it needs (at most the window height minus one).

Parameters

widget ConsoleMonster.Layout.IWidget requiredposition: 0
The content.
context ConsoleMonster.Canvas.RenderContext? = null optionalposition: 1
The render context (for example with a clock for elapsed times), or null for the terminal's.
public Void Draw(CellBuffer frame) #
Returns: Void

Draws a rendered frame as the area's new content.

Parameters

frame ConsoleMonster.Canvas.CellBuffer requiredposition: 0
The frame; one row per line.
public static Boolean IsSupported(TerminalProfile? profile = null) #
Returns: Boolean

Whether an area can be drawn on the current console: an interactive Windows console whose buffer can be read.

Parameters

profile ConsoleMonster.Capabilities.TerminalProfile? = null optionalposition: 0
The terminal profile, or null for the current one.

Returns

True when InlineArea.Draw works here.

Properties

public Int32 Height { get; } #

The rows the area occupies now (0 when it is not shown).

public Int32 MaxWidth { get; set; } #

The widest the content is drawn (0, the default, for the console's width), so short rows keep their right-aligned parts close.

public Int32 Width { get; } #

The width content is drawn at: the console's width less one column, so a full row never wraps (at most InlineArea.MaxWidth).