GraphNodeIdCollection 类

定义

包含 GraphNodeId 的列表。 这可以存储在 中。GraphNodeId 的值部分。 创建后,这是一个不可变列表。 我们使用抽象类,因为此类不知道将列表序列化回字符串所需的格式。 派生类会知道这一点。

public ref class GraphNodeIdCollection : IComparable, System::Collections::Generic::IEnumerable<Microsoft::VisualStudio::GraphModel::GraphNodeId ^>
public class GraphNodeIdCollection : IComparable, System.Collections.Generic.IEnumerable<Microsoft.VisualStudio.GraphModel.GraphNodeId>
type GraphNodeIdCollection = class
    interface IEnumerable
    interface seq<GraphNodeId>
    interface IComparable
Public Class GraphNodeIdCollection
Implements IComparable, IEnumerable(Of GraphNodeId)
继承
GraphNodeIdCollection
实现

构造函数

GraphNodeIdCollection(Boolean, GraphNodeId[])

构造 GraphNodeIdCollection。

属性

HomogeneousElements

数组元素是否是同质 (数组项名称都是相同的,因此无需重复,例如 Name=[item1,item2,item3]) 或异类 - 例如 (Name1=item1、Name2=item2、Name3=item3) )

Item[Int32]

包含 GraphNodeId 的列表。 这可以存储在 中。GraphNodeId 的值部分。 创建后,这是一个不可变列表。 我们使用抽象类,因为此类不知道将列表序列化回字符串所需的格式。 派生类会知道这一点。

Length

获取列表中的项数

方法

CompareTo(Object)

包含 GraphNodeId 的列表。 这可以存储在 中。GraphNodeId 的值部分。 创建后,这是一个不可变列表。 我们使用抽象类,因为此类不知道将列表序列化回字符串所需的格式。 派生类会知道这一点。

Equals(Object)

比较这些列表,并查看是否所有项都相等。 这假定项在列表中的顺序相同。 这是一种性能优化,需要方法参数,其中不同的顺序意味着不同的重载

GetHashCode()

计算此集合的哈希代码并缓存它

GetValueByName<T>(GraphNodeIdName)

从第一个嵌入的 GraphNodeId 中获取与名称匹配的值

ToString()

获取此 GraphNodeId 集合作为字符串

显式接口实现

IEnumerable.GetEnumerator()

获取枚举器。 这会阻止直接访问_array

IEnumerable<GraphNodeId>.GetEnumerator()

获取类型化枚举器。 这会阻止直接访问_array

扩展方法

EmptyIfNull<T>(IEnumerable<T>)

如果枚举不为 null,则返回此枚举。 如果为 null,则返回空枚举。

适用于