API Reference
ConsoleTextLayout
Lays out console text the way Write-Color does, for Write-ConsoleText and C# hosts alike: empty lines before and after, a prefix of tabs, spaces and an optional time stamp on the first line, text split at a separator with the following parts aligned under the text, wrapping that continues under the text, padding (left, right or centred, measured in terminal cells) and centring in the window.
Inheritance
- Object
- ConsoleTextLayout
Constructors
public ConsoleTextLayout() #Methods
public IReadOnlyList<StyledLine> Lines(RichText text, RenderContext context, Int32 width) #IReadOnlyList<StyledLine>The lines of a text at a width.
Parameters
- text ConsoleMonster.Text.RichText
- The text.
- context ConsoleMonster.Canvas.RenderContext
- The render context.
- width System.Int32
- The width for wrapping and centring.
Returns
The lines.
public IReadOnlyList<RichText> Parts(RichText text) #IReadOnlyList<RichText>The parts of a text after ConsoleTextLayout.SplitLines.
Parameters
- text ConsoleMonster.Text.RichText
- The text.
Returns
The parts (one when there is no separator).
Inherited Methods
public virtual Boolean Equals(Object? obj) #BooleanParameters
- obj Object?
Properties
public Int32 StartTab { get; set; } #Tabs before the text (eight cells each).
public DateTime? Time { get; set; } #The time shown in brackets at the start, or null for none.
public String TimeFormat { get; set; } #The time format (default yyyy-MM-dd HH:mm:ss).
public String? SplitLines { get; set; } #A separator the text is split at; the following parts are aligned under the first, after the prefix.
public Boolean Wrap { get; set; } #Wraps long text at the width, continuing under the text after the prefix.
public Boolean HorizontalCenter { get; set; } #Centres each line in the width.
public Int32 PadLeft { get; set; } #Pads each line on the left to this many cells (right-aligned).
public Int32 PadRight { get; set; } #Pads each line on the right to this many cells.
public Int32 PadCenter { get; set; } #Centres each line within this many cells.
public Char PadCharacter { get; set; } #The padding character (default a space).