GraphLinkCollection Class

Definition

This class manages a collection of Links. This class does not preserve the order in which you added the links, so when you enumerate them you will get them back in a random order.

public ref class GraphLinkCollection : Microsoft::VisualStudio::GraphModel::IHasGraphOwner, System::Collections::Generic::ICollection<Microsoft::VisualStudio::GraphModel::GraphLink ^>, System::Collections::Generic::IEnumerable<Microsoft::VisualStudio::GraphModel::GraphLink ^>
public class GraphLinkCollection : Microsoft.VisualStudio.GraphModel.IHasGraphOwner, System.Collections.Generic.ICollection<Microsoft.VisualStudio.GraphModel.GraphLink>, System.Collections.Generic.IEnumerable<Microsoft.VisualStudio.GraphModel.GraphLink>
type GraphLinkCollection = class
    interface ICollection<GraphLink>
    interface seq<GraphLink>
    interface IEnumerable
    interface IHasGraphOwner
Public Class GraphLinkCollection
Implements ICollection(Of GraphLink), IEnumerable(Of GraphLink), IHasGraphOwner
Inheritance
GraphLinkCollection
Implements

Properties

Count

Return the number of links in the collection.

Graph

Gets the Graph associated with this links collection

IsReadOnly

Gets a value indicating whether the System.Collections.Generic.ICollection is read-only.

Owner

Gets the Graph associated with this links collection

Methods

Add(GraphLink)

Adds a link to the graph, or merge it with an existing Link object

Add(GraphLink, GraphLink)

Adds a link to the graph, or merge it with an existing Link object

Add(IEnumerable<GraphLink>)

Add all the links in the given set.

Clear()

Remove all links in this collection

Contains(GraphLink)

Determines if the given link is in this collection

CopyTo(GraphLink[], Int32)

Copies the elements of the System.Collections.Generic.ICollection to an System.Array, starting at a particular System.Array index.

Get(GraphNode, GraphNode)

Gets the link with the specified source

Get(GraphNode, GraphNode, Int32)

Gets the link with the specified source

Get(GraphNodeId, GraphNodeId)

Gets the link with the specified source using GraphNodeId

Get(GraphNodeId, GraphNodeId, Int32)

Gets the link with the specified source and target and multi-link index

Get(String, String)

Gets the link with the specified source using node Id as strings

Get(String, String, Int32)

Gets the link with the specified source using node Id as strings and a multilink index

GetAll(GraphNode, GraphNode)

Gets all links between the given source and target nodes. Each link must have a different Index.

GetByCategory(GraphCategory[])

Returns all links in the graph that have at least one of the specified categories or have inherited categories that are in the set. For example, if we have a category "B" that inherits from the category "A" and we ask for all nodes that have a category "A" then it will return links that have either "A" or "B" categories. However, if we ask for category "B" it will only return nodes with category "B", it will not return nodes that only have category "A". In otherwords, it does not expand the search to include BasedOn categories of the given set, to do that you must call HasCategoryInSet with GraphCategoryMatchOption.Inherit.

GetByProperty(GraphProperty, Object)

Returns all links in the graph that have the specified property value.

GetEnumerator()

Gets the typed enumerator for this collection

GetFiltered(Func<GraphLink,Boolean>)

Returns all nodes in the graph that match according to the given filter

GetLinksFrom(String, GraphCategory[])

Get all links from the specified node id that have at least one of the specified categories.

GetLinksTo(String, GraphCategory[])

Get all links to the specified node id have at least one of the specified categories.

GetOrCreate(GraphNode, GraphNode)

Gets the link from the specified source to the specified target node. If not found, a new link will be created.

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.

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).

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).

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 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).

GetOrCreate(GraphNodeId, String)
GetOrCreate(String, GraphNodeId)
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).

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.

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).

Remove(GraphLink)

Removes the first occurrence of a specific object from the System.Collections.Generic.ICollection.

Remove(GraphLink, GraphLink)

Removes the first occurrence of a specific object from the System.Collections.Generic.ICollection.

Remove(GraphNodeId, GraphNodeId, 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.

Remove(IEnumerable<GraphLink>)

Remove all the links in the given set.

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.

Events

Added

This event is raised immediately when a new node is added to the collection.

Removed

This event is raised immediately when a node is removed from the collection.

Explicit Interface Implementations

IEnumerable.GetEnumerator()

Gets the enumerator for this collection

Extension Methods

EmptyIfNull<T>(IEnumerable<T>)

Applies to