GraphLinkCollection.GetOrCreate Method (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.

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

Syntax

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

Parameters

  • sourceId
    Type: String

    The source node id

  • targetId
    Type: String

    The target node id

  • index
    Type: Int32

    The link index, which gives you multiple links between the same source and target node

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