GraphNodeCollection Class

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

This class provides methods for manipulating a collection of Nodes. This class does not preserve the order in which you added the nodes, so that 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 NotInheritable Class GraphNodeCollection _
    Implements ICollection(Of GraphNode), IReadOnlyCollection(Of GraphNode),  _
    IEnumerable(Of GraphNode), IEnumerable, IHasGraphOwner
public sealed class GraphNodeCollection : ICollection<GraphNode>, 
    IReadOnlyCollection<GraphNode>, IEnumerable<GraphNode>, IEnumerable, 
    IHasGraphOwner
public ref class GraphNodeCollection sealed : ICollection<GraphNode^>, 
    IReadOnlyCollection<GraphNode^>, IEnumerable<GraphNode^>, IEnumerable, 
    IHasGraphOwner
[<Sealed>]
type GraphNodeCollection =  
    class 
        interface ICollection<GraphNode>
        interface IReadOnlyCollection<GraphNode>
        interface IEnumerable<GraphNode>
        interface IEnumerable 
        interface IHasGraphOwner 
    end
public final class GraphNodeCollection implements ICollection<GraphNode>, IReadOnlyCollection<GraphNode>, IEnumerable<GraphNode>, IEnumerable, IHasGraphOwner

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.
Public property Owner Gets the Graph associated with this nodes collection

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 CreateNew Add a new node using the given base name format for the node. This method formats the given string with integer values until it finds an id that is not currently being used, and then creates a node with that id.
Public method Equals Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method Get(String) Gets the node with the specified id
Public method Get(GraphNodeId) Gets the node with the specified id
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 Returns all nodes in the graph that match according to the given filter
Public method GetHashCode Serves as the default hash function. (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) Attempts to get the node with the specified id. If not found, it will create a new node.
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) Attempts to get the node with the specified id. If not found, it will create a new node.
Public method GetType Gets the Type of the current instance. (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) Remove the specified node
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 Added This event is raised immediately when a new node is added to the collection.
Public event Removed This event is raised immediately when a node is removed from the collection.

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