目錄 / Table of Contents

Class OdfTextBody

Namespace
OdfKit.Text
Assembly
OdfKit.dll

Exposes high-level accessors for the body of a text document. 提供文字文件本文的高階操作入口。

public sealed class OdfTextBody
Inheritance
OdfTextBody
Inherited Members

Constructors

OdfTextBody(TextDocument)

Initializes a new instance of the OdfTextBody class. 初始化 OdfTextBody 類別的新執行個體。

public OdfTextBody(TextDocument document)

Parameters

document TextDocument

The owning text document. / 所屬文字文件。

Properties

Headings

Gets the heading collection. 取得標題集合。

public OdfHeadingCollection Headings { get; }

Property Value

OdfHeadingCollection

Images

Gets the image collection. 取得圖片集合。

public OdfTextImageCollection Images { get; }

Property Value

OdfTextImageCollection

Lists

Gets the list collection. 取得清單集合。

public OdfListCollection Lists { get; }

Property Value

OdfListCollection

Paragraphs

Gets the paragraph collection. 取得段落集合。

public OdfParagraphCollection Paragraphs { get; }

Property Value

OdfParagraphCollection

Sections

Gets the collection of all sections in the document. 取得文件中的所有區段(Section)集合。

public IReadOnlyList<OdfSection> Sections { get; }

Property Value

IReadOnlyList<OdfSection>

Tables

Gets the table collection. 取得表格集合。

public OdfTextTableCollection Tables { get; }

Property Value

OdfTextTableCollection

Methods

ClearSections()

Removes all sections from the document and returns the number removed. 移除文件中的所有區段,並傳回移除數量。

public int ClearSections()

Returns

int

The number of removed sections. / 已移除的區段數量。

FindSection(string)

Finds the first section with the exact name. 尋找第一個具有精確名稱的區段。

public OdfSection? FindSection(string name)

Parameters

name string

The exact section name. / 區段的精確名稱。

Returns

OdfSection

The matching section, or null. / 相符的區段;若不存在則為 null

RemoveSection(OdfSection)

Removes the specified section from this document. 從此文件移除指定區段。

public bool RemoveSection(OdfSection section)

Parameters

section OdfSection

The section to remove. / 要移除的區段。

Returns

bool

true if the section was removed; otherwise false. / 若已移除區段則為 true,否則為 false