Class ChatLine
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
segmentsList<ChatSegment>
ChatLine(string)
public ChatLine(string plainText)
Parameters
plainTextstring
Properties
ActionSpans
Clickable sub-line targets (e.g. the "[open]" and "[save original]" brackets under an image). Columns are relative to the unwrapped line, so only the first wrapped line keeps them. Null means the whole line uses the kind's default action.
public List<AttachmentActionSpan>? ActionSpans { get; set; }
Property Value
- List<AttachmentActionSpan>
AttachmentFileName
public string? AttachmentFileName { get; set; }
Property Value
AttachmentKind
public AttachmentKind? AttachmentKind { get; set; }
Property Value
AttachmentUrl
public string? AttachmentUrl { get; set; }
Property Value
ContinuationIndent
Number of spaces to prepend on continuation lines when this line is word-wrapped.
public int ContinuationIndent { get; set; }
Property Value
ContinuationPrefixSegments
Colored segments to prepend on continuation lines instead of plain spaces (e.g. the nick-column rail " │ "). When set, takes precedence over ContinuationIndent.
public List<ChatSegment>? ContinuationPrefixSegments { get; set; }
Property Value
- List<ChatSegment>
IsMention
public bool IsMention { get; set; }
Property Value
IsUnreadMarker
True for the "new messages" unread-marker rule so it can be removed on channel switch.
public bool IsUnreadMarker { get; set; }
Property Value
JumpToMessageId
Set on a reply's quote line: activating the line jumps to this message if it is in the loaded history.
public Guid? JumpToMessageId { get; set; }
Property Value
- Guid?
MessageId
public Guid? MessageId { get; set; }
Property Value
- Guid?
RuleAttr
Color for a rule line; null falls back to DateRuleAttr.
public Attribute? RuleAttr { get; set; }
Property Value
- Attribute?
RuleLabel
When set, this line is a horizontal separator rule (date change, unread marker). The view regenerates it to the current viewport width instead of word-wrapping.
public string? RuleLabel { get; set; }
Property Value
Segments
public List<ChatSegment> Segments { get; }
Property Value
- List<ChatSegment>
SenderUsername
public string? SenderUsername { get; set; }
Property Value
TextLength
public int TextLength { get; }
Property Value
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
textstringdefaultAttrAttribute?
Returns
HasColorTags(string)
Returns true if a line contains printable color tags.
public static bool HasColorTags(string text)
Parameters
textstring
Returns
StripColorTags(string)
Remove all color tags from text, returning only the visible characters.
public static string StripColorTags(string text)
Parameters
textstring
Returns
ToString()
public override string ToString()
Returns
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
Returns
- List<ChatLine>