目錄 / Table of Contents

Class OdfListCollection

Namespace
OdfKit.Text
Assembly
OdfKit.dll

Adds text lists to text documents. 提供清單新增入口。

public sealed class OdfListCollection : IEnumerable<OdfList>, IEnumerable
Inheritance
OdfListCollection
Implements
Inherited Members

Constructors

OdfListCollection(TextDocument)

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

public OdfListCollection(TextDocument document)

Parameters

document TextDocument

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

Properties

Items

Gets a summary list of the top-level lists in the document body. 取得文件本文最上層清單清單。

public IReadOnlyList<OdfList> Items { get; }

Property Value

IReadOnlyList<OdfList>

Methods

Add()

Short overload of Add that uses default values for all optional parameters and forwards to the full overload. 便利多載:Add 的所有可選參數使用預設值並轉呼叫最長多載。

public OdfList Add()

Returns

OdfList

Add(string?)

Adds a text list to the collection. 新增清單。

public OdfList Add(string? styleName)

Parameters

styleName string

The optional list style name. / 選用的清單樣式名稱。

Returns

OdfList

The newly added list. / 新增完成的清單。

Clear()

Removes all top-level lists while preserving other body content. 移除所有最上層清單,並保留其他本文內容。

public void Clear()

Find(Predicate<OdfList>)

Finds the first top-level list that satisfies the predicate. 查找第一個符合條件的最上層清單。

public OdfList? Find(Predicate<OdfList> predicate)

Parameters

predicate Predicate<OdfList>

The list predicate. / 清單條件。

Returns

OdfList

The matching list, or null when no match exists. / 符合的清單;若找不到則為 null

GetEnumerator()

Gets an enumerator over the lists, for use with LINQ queries. 取得清單列舉器,供 LINQ 查詢使用。

public IEnumerator<OdfList> GetEnumerator()

Returns

IEnumerator<OdfList>

The list enumerator. / 清單列舉器。

Remove(OdfList)

Removes the specified top-level list. 移除指定的最上層清單。

public bool Remove(OdfList list)

Parameters

list OdfList

The list to remove. / 要移除的清單。

Returns

bool

true if the list was removed; otherwise, false. / 若已移除清單則為 true;否則為 false