다음을 통해 공유


GraphLinkCollection Class

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

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, IHasGraphOwner
public class GraphLinkCollection : ICollection<GraphLink>, 
    IEnumerable<GraphLink>, IEnumerable, IHasGraphOwner
public ref class GraphLinkCollection : ICollection<GraphLink^>, 
    IEnumerable<GraphLink^>, IEnumerable, IHasGraphOwner
type GraphLinkCollection =  
    class 
        interface ICollection<GraphLink>
        interface IEnumerable<GraphLink>
        interface IEnumerable 
        interface IHasGraphOwner 
    end
public class GraphLinkCollection implements ICollection<GraphLink>, IEnumerable<GraphLink>, IEnumerable, IHasGraphOwner

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

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) Gets the link with the specified source using GraphNodeId
Public method Get(String, String, Int32) Gets the link with the specified source using node Id as strings and a multilink index
Public method Get(GraphNode, GraphNode, Int32) Gets the link with the specified source
Public method Get(GraphNodeId, GraphNodeId, Int32) Gets the link with the specified source and target and multi-link index
Public method GetAll Gets all links between the given source and target nodes. Each link must have a different Index.
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 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 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) 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(GraphNodeId, String)
Public method GetOrCreate(String, String, Int32) Attempts to get the link with the specified source, target and multilink index If not found, a new link will be created.
Public method GetOrCreate(GraphNodeId, GraphNodeId, Int32) Attempts to get the link with the specified source, target and multi-link index. 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(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 it is 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) 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 it is 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 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, and then it removes the link also.
Public method Remove(GraphNodeId, GraphNodeId, GraphCategory) Removes the given category from the link between source and target and if this is the last category, and then it removes the link also.
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