NodeCollection

NodeCollection

概述

NodeCollection 是 Aspose.Words FOSS 中用于 .NET 的类。继承自:INodeCollection、IEnumerable<Node>。

表示特定类型节点的集合。

此类提供 9 个方法,用于在 .NET 程序中处理 NodeCollection 对象。可用的方法包括:Add、Clear、Contains、GetEnumerator、IndexOf、Insert、Remove、RemoveAt、ToArray。安装 Aspose.Words FOSS for .NET 包后,所有公共成员对任何 .NET 应用程序均可访问。属性:Count。

属性

名称类型访问描述
Countint读取获取集合中节点的数量。

方法

签名描述
Add(node: Node)将节点添加到集合的末尾。
Insert(index: int, node: Node)在集合的指定索引处插入节点。
Remove(node: Node)从集合和文档中移除该节点。
RemoveAt(index: int)从集合和文档中移除指定索引处的节点。
Clear()从此集合和文档中移除所有节点。
Contains(node: Node)确定节点是否在集合中。
IndexOf(node: Node)返回指定节点的零基索引。
ToArray()将集合中的所有节点复制到一个新的节点数组中。
GetEnumerator()提供一种简单的 “foreach” 风格的遍历,用于节点集合。

另请参阅

 中文