GraphNodeCollection 类

此类为操纵节点的收集提供方法。 此类不会保留您添加节点时所采用的顺序,因此当您枚举它们时您将以随机顺序拿回这些节点。。

继承层次结构

System.Object
  Microsoft.VisualStudio.GraphModel.GraphNodeCollection

命名空间:  Microsoft.VisualStudio.GraphModel
程序集:  Microsoft.VisualStudio.GraphModel(在 Microsoft.VisualStudio.GraphModel.dll 中)

语法

声明
Public Class GraphNodeCollection _
    Implements ICollection(Of GraphNode), IEnumerable(Of GraphNode),  _
    IEnumerable
public class GraphNodeCollection : ICollection<GraphNode>, 
    IEnumerable<GraphNode>, IEnumerable
public ref class GraphNodeCollection : ICollection<GraphNode^>, 
    IEnumerable<GraphNode^>, IEnumerable
type GraphNodeCollection =  
    class
        interface ICollection<GraphNode>
        interface IEnumerable<GraphNode>
        interface IEnumerable
    end
public class GraphNodeCollection implements ICollection<GraphNode>, IEnumerable<GraphNode>, IEnumerable

GraphNodeCollection 类型公开以下成员。

属性

  名称 说明
公共属性 Containers 返回包含的所有节点均为容器的枚举。
公共属性 Count 返回集合中的节点数。
公共属性 Graph 获取与此节点集合关联的图。
公共属性 IsReadOnly 获取指示 System.Collections.Generic.ICollection 是否为只读的值。
公共属性 Item 获取使用给出 id 的节点。如果已存在具有相同 id 的另一个节点,则将引发设置异常。

页首

方法

  名称 说明
公共方法 Add(GraphNode) 添加指向图形的链接,或将其与现有链接对象合并
公共方法 Add(IEnumerable<GraphNode>) 添加给定集合中的所有节点。
公共方法 Add(GraphNode, GraphNode%) 将指定的节点添加到图。
公共方法 Clear 移除此集合中的所有节点
公共方法 Contains 确定指定的节点是否在此集合中
公共方法 CopyTo 从特定的 System.Array 索引开始,将 System.Collections.Generic.ICollection 的元素复制到 System.Array。
公共方法 Equals 确定指定的 Object 是否等于当前的 Object。 (继承自 Object。)
受保护的方法 Finalize 允许对象在“垃圾回收”回收之前尝试释放资源并执行其他清理操作。 (继承自 Object。)
公共方法 Get(String) 获取具有指定 ID 的节点。
公共方法 Get(GraphNodeId)
公共方法 GetByCategory(array<String[]) 返回具有指定类别的关系图中的所有节点
公共方法 GetByCategory(array<GraphCategory[]) 返回具有指定类别的关系图中的所有节点。
公共方法 GetByProperty 返回具有指定属性值的关系图中的所有节点。
公共方法 GetEnumerator 获取该集合的类型枚举器。
公共方法 GetFiltered
公共方法 GetHashCode 用作特定类型的哈希函数。 (继承自 Object。)
公共方法 GetOrCreate(String) 尝试获取具有指定 ID 的节点。如果未找到节点,则将创建一个新节点。
公共方法 GetOrCreate(GraphNodeId)
公共方法 GetOrCreate(String, String, GraphCategory) 尝试获取具有指定 ID 的节点。如果未找到节点,则将创建一个新节点。
公共方法 GetOrCreate(GraphNodeId, String, GraphCategory)
公共方法 GetType 获取当前实例的 Type。 (继承自 Object。)
受保护的方法 MemberwiseClone 创建当前 Object 的浅表副本。 (继承自 Object。)
公共方法 Remove(String) 移除指定的节点
公共方法 Remove(GraphNode) 从 System.Collections.Generic.ICollection 中移除特定对象的第一个匹配项。
公共方法 Remove(IEnumerable<GraphNode>) 移除给定集中的所有节点。
公共方法 Remove(GraphNodeId)
公共方法 Remove(GraphNode, GraphNode%) 移除指定的节点
公共方法 ToString 返回表示当前对象的字符串。 (继承自 Object。)

页首

事件

  名称 说明
公共事件 NodesUpdated NodesUpdated 的事件实现。

页首

显式接口实现

  名称 说明
显式接口实现私有方法 IEnumerable.GetEnumerator 获取该集合的枚举器

页首

线程安全

此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。但不保证所有实例成员都是线程安全的。

请参见

参考

Microsoft.VisualStudio.GraphModel 命名空间