API Reference
Class
RichTextBuilder
Builds RichText fluently: new RichTextBuilder().Append("SPF ", ConsoleColor.Gray).Append("PASS", ThemeToken.Pass, TextDecoration.Bold).Build().
Inheritance
- Object
- RichTextBuilder
Usage
Explore 4 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.
Returned or exposed by 4
- Method RichTextBuilder.Append
- Method RichTextBuilder.AppendLine
- Method RichTextBuilder.AppendLink
- Method RichTextBuilder.AppendMarkup
Constructors
public RichTextBuilder() #Methods
Append 3 overloads
public RichTextBuilder Append(String? text, RichStyle style = default) #Returns:
RichTextBuilderAppends literal text.
Parameters
- text System.String?
- The text (shown as written).
- style ConsoleMonster.Styling.RichStyle = default
- The style.
Returns
This builder.
public RichTextBuilder Append(String? text, RichColor foreground, TextDecoration decoration = None, RichColor background = default) #Returns:
RichTextBuilderAppends literal text with a foreground colour, decorations and an optional background.
Parameters
- text System.String?
- The text.
- foreground ConsoleMonster.Styling.RichColor
- The foreground (a ConsoleColor, theme role or colour converts implicitly).
- decoration ConsoleMonster.Styling.TextDecoration = None
- Decorations.
- background ConsoleMonster.Styling.RichColor = default
- The background.
Returns
This builder.
public RichTextBuilder Append(RichText? text) #Returns:
RichTextBuilderAppends other rich text.
Parameters
- text ConsoleMonster.Text.RichText?
- The text.
Returns
This builder.
public RichTextBuilder AppendLine() #Returns:
RichTextBuilderAppends a line break.
Returns
This builder.
public RichTextBuilder AppendLink(String? text, String url, RichStyle style = default) #Returns:
RichTextBuilderAppends a hyperlink (OSC 8 where the terminal supports it, otherwise the text).
Parameters
- text System.String?
- The text.
- url System.String
- The target.
- style ConsoleMonster.Styling.RichStyle = default
- The style.
Returns
This builder.
public RichTextBuilder AppendMarkup(String? markup) #Returns:
RichTextBuilderAppends markup.
Parameters
- markup System.String?
- The markup.
Returns
This builder.
Inherited Methods
public virtual Boolean Equals(Object? obj) #Returns:
BooleanInherited from Object
Parameters
- obj Object?