Class OdfHeadingCollection
Adds heading paragraphs to text documents. 提供標題新增入口。
public sealed class OdfHeadingCollection : IEnumerable<OdfHeading>, IEnumerable
- Inheritance
-
OdfHeadingCollection
- Implements
- Inherited Members
Constructors
OdfHeadingCollection(TextDocument)
Initializes a new instance of the OdfHeadingCollection class. 初始化 OdfHeadingCollection 類別的新執行個體。
public OdfHeadingCollection(TextDocument document)
Parameters
documentTextDocumentThe owning text document. / 所屬文字文件。
Properties
Items
Gets a summary list of the top-level headings in the document body. 取得文件本文最上層標題清單。
public IReadOnlyList<OdfHeading> Items { get; }
Property Value
Methods
Add(string)
Short overload of Add that accepts text; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 text;其餘可選參數使用預設值並轉呼叫最長 Add 多載。
public OdfHeading Add(string text)
Parameters
textstring
Returns
Add(string, int)
Adds a heading paragraph to the collection. 新增標題。
public OdfHeading Add(string text, int outlineLevel)
Parameters
Returns
- OdfHeading
The newly added heading. / 新增完成的標題。
Clear()
Removes all top-level headings while preserving other body content. 移除所有最上層標題,並保留其他本文內容。
public void Clear()
Find(Predicate<OdfHeading>)
Finds the first top-level heading that satisfies the predicate. 查找第一個符合條件的最上層標題。
public OdfHeading? Find(Predicate<OdfHeading> predicate)
Parameters
predicatePredicate<OdfHeading>The heading predicate. / 標題條件。
Returns
- OdfHeading
The matching heading, or null when no match exists. / 符合的標題;若找不到則為 null。
GetEnumerator()
Gets an enumerator over the headings, for use with LINQ queries. 取得標題列舉器,供 LINQ 查詢使用。
public IEnumerator<OdfHeading> GetEnumerator()
Returns
- IEnumerator<OdfHeading>
The heading enumerator. / 標題列舉器。
Remove(OdfHeading)
Removes the specified top-level heading. 移除指定的最上層標題。
public bool Remove(OdfHeading heading)
Parameters
headingOdfHeadingThe heading to remove. / 要移除的標題。