Table of Contents

Class RichText

Namespace
SheetStream
Assembly
SheetStream.dll

One formatted run of text inside a rich-text cell. Unset properties inherit the cell's font.

public sealed class RichText
Inheritance
RichText
Inherited Members

Examples

sheet.Row().WriteRichText(new RichText("Status: "), new RichText("LATE") { Bold = true, Color = "#C00000" });

Constructors

RichText(string)

Creates a run with the given text.

public RichText(string text)

Parameters

text string

Properties

Bold

Bold run.

public bool Bold { get; set; }

Property Value

bool

Color

Text colour as hex, or null to inherit. Validated on assignment.

public string? Color { get; set; }

Property Value

string

FontName

Font name, or null to inherit.

public string? FontName { get; set; }

Property Value

string

Italic

Italic run.

public bool Italic { get; set; }

Property Value

bool

Size

Font size in points, or null to inherit.

public double? Size { get; set; }

Property Value

double?

Strikethrough

Struck-through run.

public bool Strikethrough { get; set; }

Property Value

bool

Text

The run's text.

public string Text { get; }

Property Value

string

Underline

Underlined run.

public bool Underline { get; set; }

Property Value

bool

Operators

implicit operator RichText(string)

Implicit conversion so plain strings can be mixed with formatted runs.

public static implicit operator RichText(string text)

Parameters

text string

Returns

RichText