目錄 / Table of Contents

Class OdfTextTableCollection

Namespace
OdfKit.Text
Assembly
OdfKit.dll

Adds text tables to text documents. 提供表格新增入口。

public sealed class OdfTextTableCollection : IEnumerable<OdfTextTableInfo>, IEnumerable
Inheritance
OdfTextTableCollection
Implements
Inherited Members

Constructors

OdfTextTableCollection(TextDocument)

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

public OdfTextTableCollection(TextDocument document)

Parameters

document TextDocument

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

Properties

Items

Gets a summary list of the top-level text tables in the document body. 取得文件本文最上層文字表格摘要清單。

public IReadOnlyList<OdfTextTableInfo> Items { get; }

Property Value

IReadOnlyList<OdfTextTableInfo>

Methods

Add(int, int)

Adds a text table to the collection. 新增表格。

public OdfTable Add(int rows, int columns)

Parameters

rows int

The row count. / 列數。

columns int

The column count. / 欄數。

Returns

OdfTable

The newly added table. / 新增完成的表格。

Clear()

Removes all top-level text tables while preserving other body content. 移除所有最上層文字表格,並保留其他本文內容。

public void Clear()

Find(string)

Finds the first top-level table with the specified name. 查找第一個具有指定名稱的最上層表格。

public OdfTextTableInfo? Find(string name)

Parameters

name string

The table name. / 表格名稱。

Returns

OdfTextTableInfo

The matching table information, or null when no match exists. / 符合的表格資訊;若找不到則為 null

GetEnumerator()

Gets an enumerator over the text table summaries, for use with LINQ queries. 取得文字表格摘要列舉器,供 LINQ 查詢使用。

public IEnumerator<OdfTextTableInfo> GetEnumerator()

Returns

IEnumerator<OdfTextTableInfo>

The text table summary enumerator. / 文字表格摘要列舉器。

Remove(OdfTextTableInfo)

Removes the specified top-level text table. 移除指定的最上層文字表格。

public bool Remove(OdfTextTableInfo table)

Parameters

table OdfTextTableInfo

The table information to remove. / 要移除的表格資訊。

Returns

bool

true if the table was removed; otherwise, false. / 若已移除表格則為 true;否則為 false