# Class ChatLine | EchoHub Documentation
A single line in the chat, composed of colored segments.

# 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
  object
  ChatLine

Inherited Members
  object.GetType()
  object.MemberwiseClone()
  object.Equals(object)
  object.Equals(object, object)
  object.ReferenceEquals(object, object)
  object.GetHashCode()

## Constructors

### ChatLine(List<ChatSegment>)

    public ChatLine(List<ChatSegment> segments)

#### Parameters

`segments` List<ChatSegment>

### ChatLine(string)

    public ChatLine(string plainText)

#### Parameters

`plainText` string

## 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

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

### 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

bool

### IsUnreadMarker

True for the "new messages" unread-marker rule so it can be removed on channel switch.

    public bool IsUnreadMarker { get; set; }

#### Property Value

bool

### 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

string

### 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>