Table of Contents

Class OdfRichText

Namespace
OdfKit.Spreadsheet
Assembly
OdfKit.dll

Represents rich text content for an ODS cell, composed of multiple OdfRichTextRun instances. 代表 ODS 儲存格的富文字內容,由多個 OdfRichTextRun 組成。

public sealed class OdfRichText
Inheritance
OdfRichText
Inherited Members

Constructors

OdfRichText()

public OdfRichText()

Properties

Runs

Gets all formatted runs. 取得所有格式片段。

public IReadOnlyList<OdfRichTextRun> Runs { get; }

Property Value

IReadOnlyList<OdfRichTextRun>

Methods

AddLineBreak()

Adds a line break run. 新增一個換行片段。

public OdfRichText AddLineBreak()

Returns

OdfRichText

The current rich text object for chaining. / 目前富文字物件,方便鏈式呼叫。

AddRun(string)

Adds a plain text run with default formatting. 以預設格式新增純文字片段。

public OdfRichText AddRun(string text)

Parameters

text string

The run text. / 片段文字。

Returns

OdfRichText

The current rich text object for chaining. / 目前富文字物件,方便鏈式呼叫。

AddRun(string, OdfRichTextRunOptions)

Adds a formatted run using an options object. 以 options 物件新增格式片段。

public OdfRichText AddRun(string text, OdfRichTextRunOptions options)

Parameters

text string

The run text. / 片段文字。

options OdfRichTextRunOptions

The run formatting options. / 片段格式選項。

Returns

OdfRichText

The current rich text object for chaining. / 目前富文字物件,方便鏈式呼叫。

Clear()

Clears all formatted runs. 清除所有格式片段。

public void Clear()