Table of Contents

Class ChatLine

Namespace
EchoHub.Client.UI
Assembly
EchoHub.Client.dll

A single line in the chat, composed of colored segments.

public class ChatLine
Inheritance
ChatLine
Inherited Members

Constructors

ChatLine(List<ChatSegment>)

public ChatLine(List<ChatSegment> segments)

Parameters

segments List<ChatSegment>

ChatLine(string)

public ChatLine(string plainText)

Parameters

plainText string

Properties

IsMention

public bool IsMention { get; set; }

Property Value

bool

MessageId

public Guid? MessageId { get; set; }

Property Value

Guid?

Segments

public List<ChatSegment> Segments { get; }

Property Value

List<ChatSegment>

TextLength

public int TextLength { get; }

Property Value

int

Methods

FromColoredText(string, Attribute?)

Parse a string containing printable color tags into colored segments. Format: {F:RRGGBB} (foreground), {B:RRGGBB} (background), {X} (reset).

public static ChatLine FromColoredText(string text, Attribute? defaultAttr = null)

Parameters

text string
defaultAttr Attribute?

Returns

ChatLine

HasColorTags(string)

Returns true if a line contains printable color tags.

public static bool HasColorTags(string text)

Parameters

text string

Returns

bool

StripColorTags(string)

Remove all color tags from text, returning only the visible characters.

public static string StripColorTags(string text)

Parameters

text string

Returns

string

ToString()

public override string ToString()

Returns

string

Wrap(int, int)

Wrap this line into multiple lines that fit within the given width. Continuation lines are indented with the specified number of spaces.

public List<ChatLine> Wrap(int width, int continuationIndent = 0)

Parameters

width int
continuationIndent int

Returns

List<ChatLine>