Table of Contents

Class Line

Namespace
MiniTui
Assembly
MiniTui.dll

A single line of styled spans.

[SuppressMessage("ApiDesign", "RS0026:Do not add multiple public overloads with optional parameters", Justification = "Spans or a string: the first parameter's type picks the constructor, so calls are never ambiguous.")]
public sealed record Line : IEquatable<Line>
Inheritance
Line
Implements
Inherited Members

Constructors

Line(IReadOnlyList<Span>, Alignment)

A single line of styled spans.

public Line(IReadOnlyList<Span> Spans, Alignment Alignment = Alignment.Left)

Parameters

Spans IReadOnlyList<Span>

The spans, drawn left to right.

Alignment Alignment

Alignment used by widgets that lay out lines, such as Paragraph.

Line(string, Style)

A line with a single span.

[SuppressMessage("ApiDesign", "RS0026:Do not add multiple public overloads with optional parameters", Justification = "Spans or a string: the first parameter's type picks the constructor, so calls are never ambiguous.")]
public Line(string content, Style style = default)

Parameters

content string
style Style

Properties

Alignment

Alignment used by widgets that lay out lines, such as Paragraph.

public Alignment Alignment { get; init; }

Property Value

Alignment

Spans

The spans, drawn left to right.

public IReadOnlyList<Span> Spans { get; init; }

Property Value

IReadOnlyList<Span>

Width

Display width in columns.

public int Width { get; }

Property Value

int

Operators

implicit operator Line(string)

An unstyled line.

public static implicit operator Line(string s)

Parameters

s string

Returns

Line