API Reference
InlineArea
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
- The terminal profile, or null for the current one.
Methods
public Void Abandon() #VoidForgets the area without touching the screen (it stays as printed text).
public Void Clear() #VoidRemoves the area; later output starts where it was (or, after other output, where that output ended).
public Void Dispose() #VoidPerforms application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Void Draw(IWidget widget, RenderContext? context = null) #VoidDraws 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
- The content.
- context ConsoleMonster.Canvas.RenderContext? = null
- The render context (for example with a clock for elapsed times), or null for the terminal's.
public Void Draw(CellBuffer frame) #VoidDraws a rendered frame as the area's new content.
Parameters
- frame ConsoleMonster.Canvas.CellBuffer
- The frame; one row per line.
public static Boolean IsSupported(TerminalProfile? profile = null) #BooleanWhether an area can be drawn on the current console: an interactive Windows console whose buffer can be read.
Parameters
- profile ConsoleMonster.Capabilities.TerminalProfile? = null
- The terminal profile, or null for the current one.
Returns
True when InlineArea.Draw works here.
Inherited Methods
public virtual Boolean Equals(Object? obj) #BooleanParameters
- obj Object?
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).