Delen via


GraphLinkCollection.GetOrCreate Method (GraphNodeId, GraphNodeId, Int32)

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

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

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

Syntax

'Declaration
Public Function GetOrCreate ( _
    sourceId As GraphNodeId, _
    targetId As GraphNodeId, _
    index As Integer _
) As GraphLink
public GraphLink GetOrCreate(
    GraphNodeId sourceId,
    GraphNodeId targetId,
    int index
)
public:
GraphLink^ GetOrCreate(
    GraphNodeId^ sourceId, 
    GraphNodeId^ targetId, 
    int index
)
member GetOrCreate : 
        sourceId:GraphNodeId * 
        targetId:GraphNodeId * 
        index:int -> GraphLink
public function GetOrCreate(
    sourceId : GraphNodeId, 
    targetId : GraphNodeId, 
    index : int
) : GraphLink

Parameters

Return Value

Type: Microsoft.VisualStudio.GraphModel.GraphLink
The Link that was found or created

.NET Framework Security

See Also

Reference

GraphLinkCollection Class

GetOrCreate Overload

Microsoft.VisualStudio.GraphModel Namespace