Skip to content
ConsoleMonster

API Reference

Class

StyledLine

Namespace ConsoleMonster.Text
Assembly ConsoleMonster
Implements
IReadOnlyList<TextSpan> IReadOnlyCollection<TextSpan> IEnumerable<TextSpan> IEnumerable
Modifiers sealed
Attributes
DefaultMember("Item")

One line of styled spans (no line breaks). Immutable once created.

Inheritance

  • Object
  • StyledLine

Usage

Explore 43 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 23

Constructors

public StyledLine(IEnumerable<TextSpan> spans) #

Creates a line from spans. Line breaks inside spans are replaced with spaces.

Parameters

spans System.Collections.Generic.IEnumerable<ConsoleMonster.Text.TextSpan> requiredposition: 0
The spans.

Methods

public static StyledLine From(String text, Style style = default) #
Returns: StyledLine

Creates a single-span line.

Parameters

text System.String requiredposition: 0
The text.
style ConsoleMonster.Styling.Style = default optionalposition: 1
The style.

Returns

The line.

public IEnumerator<TextSpan> GetEnumerator() #
Returns: IEnumerator<TextSpan>

Returns an enumerator that iterates through the collection.

Returns

An enumerator that can be used to iterate through the collection.

public override String ToString() #
Returns: String

Returns a string that represents the current object.

Returns

A string that represents the current object.

public StyledLine WithBaseStyle(Style baseStyle) #
Returns: StyledLine

Returns a copy with baseStyle layered under every span.

Parameters

baseStyle ConsoleMonster.Styling.Style requiredposition: 0
The style underneath.

Returns

A new line.

Properties

public static StyledLine Empty { get; } #

An empty line.

public Int32 Count { get; } #

Gets the number of elements in the collection.

public TextSpan this[Int32 index] { get; } #

Gets the element at the specified index in the read-only list.

Parameters

index System.Int32 requiredposition: 0
The zero-based index of the element to get.
public Int32 Width { get; } #

Display width in cells.

public String PlainText { get; } #

The text without styles.