OutlineCollection

OutlineCollection

概述

OutlineCollection 是 Aspose.PDF FOSS 中用于 .NET 的类。继承自:Outlines,System.Collections.Generic.IEnumerable<OutlineItem>。

此类提供 12 个方法,用于在 .NET 程序中处理 OutlineCollection 对象。可用的方法包括:Add、Clear、Contains、CopyTo、Delete、GetEnumerator、OutlineCollection、Remove。在安装 Aspose.PDF FOSS for .NET 包后,所有公共成员均可被任何 .NET 应用访问。属性:Count、First、IsReadOnly、IsSynchronized、Items、Last,以及另外 2 项。

属性

名称类型访问描述
ItemsIReadOnlyList<OutlineItem>读取顶层大纲项目。
Countint读取获取计数。
FirstOutlineItemCollection?读取第一个顶层大纲项目,如果集合为空则为 null。
LastOutlineItemCollection?读取最后一个顶层大纲项,如果集合为空则为 null。
IsReadOnlybool读取始终为 false:集合是可变的。
IsSynchronizedbool读取始终为 false:调用者自行序列化其访问。
SyncRootobject读取用于 ICollection.SyncRoot 风格锁定的哨兵对象。
VisibleCountint读取当前可见的大纲项总数(PDF /Count of the /Outlines root):每个顶层项,加上每个已展开项的可见子项数量。

方法

签名描述
GetEnumerator()枚举顶层大纲项,类型为 OutlineItemCollection 以匹配公共反射签名。
OutlineCollection(document: Document)创建一个绑定到文档书签树的纲要集合,如果文档没有 /Outlines,则创建一个空的 /Outlines 字典(镜像 Outlines)。
Delete()从集合中移除所有纲要项。
Delete(name: string)移除具有指定名称的纲要项(与 Title 匹配)。
Add(item: OutlineItem)向集合中添加一个大纲项。
Add(outline: OutlineItemCollection)添加一个类型为 OutlineItemCollection 的项(公共重载签名)。
Clear()从集合中移除所有项(相当于 Delete())。
Contains(item: OutlineItemCollection)项当前是否在集合中。
CopyTo(array: OutlineItemCollection[], index: int)将项目复制到数组中,从索引开始。
Remove(item: OutlineItem)通过引用移除提供的项,并报告其是否存在。
Remove(item: OutlineItemCollection)通过引用移除 OutlineItemCollection 类型的项;报告其是否存在。
Remove(index: int)移除给定的基于 1 的索引处的项,匹配基于 1 的 this[int] 索引器。

另请参阅

 中文