GraphNodeCollection Class

This class provides methods for manipulating a collection of Nodes. This class does not preserve the order in which you added the nodes, so when you enumerate them you will get them back in a random order.

Inheritance Hierarchy

System.Object
  Microsoft.VisualStudio.GraphModel.GraphNodeCollection

Namespace:  Microsoft.VisualStudio.GraphModel
Assembly:  Microsoft.VisualStudio.GraphModel (in Microsoft.VisualStudio.GraphModel.dll)

Syntax

'Declaration
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

The GraphNodeCollection type exposes the following members.

Properties

  Name Description
Public property Containers Returns an enumerable which consists of all nodes that are containers.
Public property Count Return the number of nodes in the collection.
Public property Graph Gets the Graph associated with this nodes collection
Public property IsReadOnly Gets a value indicating whether the System.Collections.Generic.ICollection is read-only.
Public property Item Gets the Node using the given id. Throws exception on set if another node with the same id already exists.

Top

Methods

  Name Description
Public method Add(GraphNode) Adds a link to the graph, or merge it with an existing Link object
Public method Add(IEnumerable<GraphNode>) Add all the nodes in the given set.
Public method Add(GraphNode, GraphNode%) Adds the specified node to the graph.
Public method Clear Remove all nodes in the collection
Public method Contains Determines if the given node is in this collection
Public method CopyTo Copies the elements of the System.Collections.Generic.ICollection to an System.Array, starting at a particular System.Array index.
Public method Equals Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method Get(String) Gets the node with the specified id
Public method Get(GraphNodeId)
Public method GetByCategory(array<String[]) Returns all nodes in the graph that have the specified categories
Public method GetByCategory(array<GraphCategory[]) Returns all nodes in the graph that have the specified categories.
Public method GetByProperty Returns all nodes in the graph that have the specified property value.
Public method GetEnumerator Gets the typed enumerator for this collection
Public method GetFiltered
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetOrCreate(String) Attempts to get the node with the specified id. If not found, it will create a new node.
Public method GetOrCreate(GraphNodeId)
Public method GetOrCreate(String, String, GraphCategory) Attempts to get the node with the specified id. If not found, it will create a new node.
Public method GetOrCreate(GraphNodeId, String, GraphCategory)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method Remove(String) Remove the specified node
Public method Remove(GraphNode) Removes the first occurrence of a specific object from the System.Collections.Generic.ICollection.
Public method Remove(IEnumerable<GraphNode>) Remove all the nodes in the given set.
Public method Remove(GraphNodeId)
Public method Remove(GraphNode, GraphNode%) Remove the specified node
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Events

  Name Description
Public event NodesUpdated Event implementation for NodesUpdated.

Top

Explicit Interface Implementations

  Name Description
Explicit interface implemetationPrivate method IEnumerable.GetEnumerator Gets the enumerator for this collection

Top

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.VisualStudio.GraphModel Namespace