Table of Contents

Class ChatLine

Namespace
EchoHub.Client.UI.Chat
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

AttachmentFileName

public string? AttachmentFileName { get; set; }

Property Value

string

AttachmentKind

public AttachmentKind? AttachmentKind { get; set; }

Property Value

AttachmentKind?

AttachmentUrl

public string? AttachmentUrl { get; set; }

Property Value

string

ContinuationIndent

Number of spaces to prepend on continuation lines when this line is word-wrapped.

public int ContinuationIndent { get; set; }

Property Value

int

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>

SenderUsername

public string? SenderUsername { get; set; }

Property Value

string

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>