共用方式為


GraphNodeCollection 類別

定義

這個類別提供用來操作 Nodes 集合的方法。 這個類別不會保留您新增節點的順序,因此當您列舉節點時,會以隨機順序傳回它們。

public ref class GraphNodeCollection sealed : Microsoft::VisualStudio::GraphModel::IReadOnlyCollection<Microsoft::VisualStudio::GraphModel::GraphNode ^>, System::Collections::Generic::ICollection<Microsoft::VisualStudio::GraphModel::GraphNode ^>, System::Collections::Generic::IEnumerable<Microsoft::VisualStudio::GraphModel::GraphNode ^>
public sealed class GraphNodeCollection : Microsoft.VisualStudio.GraphModel.IReadOnlyCollection<Microsoft.VisualStudio.GraphModel.GraphNode>, System.Collections.Generic.ICollection<Microsoft.VisualStudio.GraphModel.GraphNode>, System.Collections.Generic.IEnumerable<Microsoft.VisualStudio.GraphModel.GraphNode>
type GraphNodeCollection = class
    interface ICollection<GraphNode>
    interface seq<GraphNode>
    interface IEnumerable
    interface IReadOnlyCollection<GraphNode>
    interface IHasGraphOwner
Public NotInheritable Class GraphNodeCollection
Implements ICollection(Of GraphNode), IEnumerable(Of GraphNode), IReadOnlyCollection(Of GraphNode)
繼承
GraphNodeCollection
實作

屬性

Containers

傳回可列舉,其中包含所有屬於容器的節點。

Count

傳回集合中的節點數目。

Graph

取得與此節點集合相關聯的 Graph

IsReadOnly

取得值,指出 System.Collections.Generic.ICollection 是否為唯讀。

Item[String]

使用指定的識別碼取得節點。如果已有相同標識碼的另一個節點存在,則會在設定時擲回例外狀況。

Owner

取得與此節點集合相關聯的 Graph

方法

Add(GraphNode)

將連結加入至圖形,或將它與現有的Link物件合併

Add(GraphNode, GraphNode)

將指定的節點加入至圖形。

Add(IEnumerable<GraphNode>)

新增指定集合中的所有節點。

Clear()

拿掉集合中的所有節點

Contains(GraphNode)

判斷指定的節點是否在此集合中

CopyTo(GraphNode[], Int32)

從特定的 System.Array 索引開始,將 System.Collections.Generic.ICollection 的專案複製到 System.Array。

CreateNew(String)

使用節點的指定基底名稱格式新增節點。 這個方法會將指定的字串格式化為整數值,直到找到目前未使用中的標識碼為止,然後建立具有該標識符的節點。

Get(GraphNodeId)

取得具有指定標識碼的節點

Get(String)

取得具有指定標識碼的節點

GetByCategory(GraphCategory[])

傳回圖形中至少有一個指定類別或繼承集合中類別的所有節點。 例如,如果我們有繼承自 [類型] 類別目錄的 [類別] 類別,而且會要求具有 [類型] 類別目錄的所有節點,則會傳回具有類別或類型類別目錄的節點。 不過,如果我們要求「類別」類別,它只會傳回類別類別的節點,它不會傳回只有「類型」類別的節點。 在其他字詞中,它不會展開搜尋以包含指定集合的 BasedOn 類別,若要這麼做,您必須使用 GraphCategoryMatchOption.Inherit 呼叫 HasCategoryInSet。

GetByCategory(String[])

傳回圖形中具有指定類別的所有節點

GetByProperty(GraphProperty, Object)

傳回圖形中具有指定屬性值的所有節點。

GetEnumerator()

取得這個集合的具型別列舉值

GetFiltered(Predicate<GraphNode>)

傳回圖表中根據指定篩選條件比對的所有節點

GetOrCreate(GraphNodeId)

嘗試取得具有指定標識碼的節點。如果找不到,則會建立新的節點。

GetOrCreate(GraphNodeId, String, GraphCategory)

嘗試取得具有指定標識碼的節點。如果找不到,則會建立新的節點。

GetOrCreate(String)

嘗試取得具有指定標識碼的節點。如果找不到,則會建立新的節點。

GetOrCreate(String, String, GraphCategory)

嘗試取得具有指定標識碼的節點。如果找不到,則會建立新的節點。

Remove(GraphNode)

從 System.Collections.Generic.ICollection 中移除第一個出現的特定物件。

Remove(GraphNode, GraphNode)

拿掉指定的節點

Remove(GraphNodeId)

拿掉指定的節點

Remove(IEnumerable<GraphNode>)

拿掉指定集合中的所有節點。

Remove(String)

拿掉指定的節點

事件

Added

當新的節點加入至集合時,會立即引發此事件。

Removed

從集合中移除節點時,會立即引發此事件。

明確介面實作

IEnumerable.GetEnumerator()

取得這個集合的列舉值

擴充方法

EmptyIfNull<T>(IEnumerable<T>)

如果不是 Null,則傳回這個列舉。 如果是 null,則傳回空列舉。

適用於