Share via


GraphLinkCollection Class

Instances of this class manage a collection of Links. Ordering is not preserved.

Inheritance Hierarchy

System.Object
  Microsoft.VisualStudio.GraphModel.GraphLinkCollection

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

Syntax

'Declaration
Public Class GraphLinkCollection _
    Implements ICollection(Of GraphLink), IEnumerable(Of GraphLink),  _
    IEnumerable
public class GraphLinkCollection : ICollection<GraphLink>, 
    IEnumerable<GraphLink>, IEnumerable
public ref class GraphLinkCollection : ICollection<GraphLink^>, 
    IEnumerable<GraphLink^>, IEnumerable
type GraphLinkCollection =  
    class
        interface ICollection<GraphLink>
        interface IEnumerable<GraphLink>
        interface IEnumerable
    end
public class GraphLinkCollection implements ICollection<GraphLink>, IEnumerable<GraphLink>, IEnumerable

The GraphLinkCollection type exposes the following members.

Properties

  Name Description
Public property Count Return the number of links in the collection.
Public property Graph Gets the Graph associated with this links collection
Public property IsReadOnly Gets a value indicating whether the System.Collections.Generic.ICollection is read-only.

Top

Methods

  Name Description
Public method Add(GraphLink) Adds a link to the graph, or merge it with an existing Link object
Public method Add(IEnumerable<GraphLink>) Add all the links in the given set.
Public method Add(GraphLink, GraphLink%) Adds a link to the graph, or merge it with an existing Link object
Public method Clear Remove all links in this collection
Public method Contains Determines if the given link 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, String) Gets the link with the specified source using node Id as strings
Public method Get(GraphNode, GraphNode) Gets the link with the specified source
Public method Get(GraphNodeId, GraphNodeId)
Public method GetByCategory Returns all links in the graph that contain one or more of the specified categories.
Public method GetByProperty Returns all links 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 GetLinksFrom Get all links from the specified node id that have at least one of the specified categories.
Public method GetLinksTo Get all links to the specified node id have at least one of the specified categories.
Public method GetOrCreate(String, GraphNodeId)
Public method GetOrCreate(String, String) Attempts to get the link with the specified source, target. If not found, a new link will be created. It also creates the source and target Node if those are not already defined (and these are created with no category).
Public method GetOrCreate(GraphNode, GraphNode) Gets the link from the specified source to the specified target node. If not found, a new link will be created.
Public method GetOrCreate(GraphNodeId, GraphNodeId)
Public method GetOrCreate(GraphNodeId, String)
Public method GetOrCreate(String, String, String, GraphCategory) Attempts to get the link with the specified source, target. If not found, a new link will be created. It also adds the specified category if its not already defined. It also creates the source and target Node if those are not already defined (and these are created with no category).
Public method GetOrCreate(GraphNode, GraphNode, String, GraphCategory) Gets the link from the specified source to the specified target node. If not found, a new link will be created.
Public method GetOrCreate(GraphNodeId, 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(GraphLink) Removes the first occurrence of a specific object from the System.Collections.Generic.ICollection.
Public method Remove(IEnumerable<GraphLink>) Remove all the links in the given set.
Public method Remove(GraphLink, GraphLink%) Removes the first occurrence of a specific object from the System.Collections.Generic.ICollection.
Public method Remove(String, String, GraphCategory) Removes the given category from the link between source and target and if this is the last category, then it removes the link as well.
Public method Remove(GraphNodeId, GraphNodeId, GraphCategory)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Events

  Name Description
Public event LinksUpdated Event implementation for LinksUpdated. We don't use an implicit C# event here because we want to only listen on the TransactedDictionaryChanges if there are clients listening on us. (For perf reasons).

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