GraphLinkCollection.GetOrCreate Method

Definition

Overloads

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

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

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

public:
 Microsoft::VisualStudio::GraphModel::GraphLink ^ GetOrCreate(Microsoft::VisualStudio::GraphModel::GraphNode ^ source, Microsoft::VisualStudio::GraphModel::GraphNode ^ target);
public Microsoft.VisualStudio.GraphModel.GraphLink GetOrCreate (Microsoft.VisualStudio.GraphModel.GraphNode source, Microsoft.VisualStudio.GraphModel.GraphNode target);
member this.GetOrCreate : Microsoft.VisualStudio.GraphModel.GraphNode * Microsoft.VisualStudio.GraphModel.GraphNode -> Microsoft.VisualStudio.GraphModel.GraphLink
Public Function GetOrCreate (source As GraphNode, target As GraphNode) As GraphLink

Parameters

source
GraphNode

Source node

target
GraphNode

Target node

Returns

The Link that was found or created

Applies to

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

public:
 Microsoft::VisualStudio::GraphModel::GraphLink ^ GetOrCreate(Microsoft::VisualStudio::GraphModel::GraphNodeId ^ sourceId, Microsoft::VisualStudio::GraphModel::GraphNodeId ^ targetId, System::String ^ label, Microsoft::VisualStudio::GraphModel::GraphCategory ^ category);
public Microsoft.VisualStudio.GraphModel.GraphLink GetOrCreate (Microsoft.VisualStudio.GraphModel.GraphNodeId sourceId, Microsoft.VisualStudio.GraphModel.GraphNodeId targetId, string label, Microsoft.VisualStudio.GraphModel.GraphCategory category);
member this.GetOrCreate : Microsoft.VisualStudio.GraphModel.GraphNodeId * Microsoft.VisualStudio.GraphModel.GraphNodeId * string * Microsoft.VisualStudio.GraphModel.GraphCategory -> Microsoft.VisualStudio.GraphModel.GraphLink
Public Function GetOrCreate (sourceId As GraphNodeId, targetId As GraphNodeId, label As String, category As GraphCategory) As GraphLink

Parameters

sourceId
GraphNodeId

The source node

targetId
GraphNodeId

The target node

label
String

The displayable label of the link

category
GraphCategory

An initial category to add to this link

Returns

The Link that was found or created

Exceptions

thrown is sourceId or targetId is null or empty string

Applies to

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:
 Microsoft::VisualStudio::GraphModel::GraphLink ^ GetOrCreate(Microsoft::VisualStudio::GraphModel::GraphNode ^ source, Microsoft::VisualStudio::GraphModel::GraphNode ^ target, System::String ^ label, Microsoft::VisualStudio::GraphModel::GraphCategory ^ category);
public Microsoft.VisualStudio.GraphModel.GraphLink GetOrCreate (Microsoft.VisualStudio.GraphModel.GraphNode source, Microsoft.VisualStudio.GraphModel.GraphNode target, string label, Microsoft.VisualStudio.GraphModel.GraphCategory category);
member this.GetOrCreate : Microsoft.VisualStudio.GraphModel.GraphNode * Microsoft.VisualStudio.GraphModel.GraphNode * string * Microsoft.VisualStudio.GraphModel.GraphCategory -> Microsoft.VisualStudio.GraphModel.GraphLink
Public Function GetOrCreate (source As GraphNode, target As GraphNode, label As String, category As GraphCategory) As GraphLink

Parameters

source
GraphNode

The source node

target
GraphNode

The target node

label
String

The displayable label of the link

category
GraphCategory

An initial category to add to this link

Returns

The Link that was found or created

Applies to

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:
 Microsoft::VisualStudio::GraphModel::GraphLink ^ GetOrCreate(System::String ^ sourceId, System::String ^ targetId, int index);
public Microsoft.VisualStudio.GraphModel.GraphLink GetOrCreate (string sourceId, string targetId, int index);
member this.GetOrCreate : string * string * int -> Microsoft.VisualStudio.GraphModel.GraphLink
Public Function GetOrCreate (sourceId As String, targetId As String, index As Integer) As GraphLink

Parameters

sourceId
String

The source node id

targetId
String

The target node id

index
Int32

The link index, which allows you to have multiple links between the same source and target node

Returns

The Link that was found or created

Applies to

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:
 Microsoft::VisualStudio::GraphModel::GraphLink ^ GetOrCreate(Microsoft::VisualStudio::GraphModel::GraphNodeId ^ sourceId, Microsoft::VisualStudio::GraphModel::GraphNodeId ^ targetId, int index);
public Microsoft.VisualStudio.GraphModel.GraphLink GetOrCreate (Microsoft.VisualStudio.GraphModel.GraphNodeId sourceId, Microsoft.VisualStudio.GraphModel.GraphNodeId targetId, int index);
member this.GetOrCreate : Microsoft.VisualStudio.GraphModel.GraphNodeId * Microsoft.VisualStudio.GraphModel.GraphNodeId * int -> Microsoft.VisualStudio.GraphModel.GraphLink
Public Function GetOrCreate (sourceId As GraphNodeId, targetId As GraphNodeId, index As Integer) As GraphLink

Parameters

sourceId
GraphNodeId

The source node

targetId
GraphNodeId

The target node

index
Int32

The multi-link index

Returns

The Link that was found or created

Applies to

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:
 Microsoft::VisualStudio::GraphModel::GraphLink ^ GetOrCreate(System::String ^ sourceId, System::String ^ targetId, System::String ^ label, Microsoft::VisualStudio::GraphModel::GraphCategory ^ category);
public Microsoft.VisualStudio.GraphModel.GraphLink GetOrCreate (string sourceId, string targetId, string label, Microsoft.VisualStudio.GraphModel.GraphCategory category);
member this.GetOrCreate : string * string * string * Microsoft.VisualStudio.GraphModel.GraphCategory -> Microsoft.VisualStudio.GraphModel.GraphLink
Public Function GetOrCreate (sourceId As String, targetId As String, label As String, category As GraphCategory) As GraphLink

Parameters

sourceId
String

The source node

targetId
String

The target node

label
String

The displayable label of the link

category
GraphCategory

An initial category to add to this link

Returns

The Link that was found or created

Exceptions

thrown is sourceId or targetId is null or empty string

Applies to

GetOrCreate(String, GraphNodeId)

public:
 Microsoft::VisualStudio::GraphModel::GraphLink ^ GetOrCreate(System::String ^ sourceId, Microsoft::VisualStudio::GraphModel::GraphNodeId ^ targetId);
public Microsoft.VisualStudio.GraphModel.GraphLink GetOrCreate (string sourceId, Microsoft.VisualStudio.GraphModel.GraphNodeId targetId);
member this.GetOrCreate : string * Microsoft.VisualStudio.GraphModel.GraphNodeId -> Microsoft.VisualStudio.GraphModel.GraphLink
Public Function GetOrCreate (sourceId As String, targetId As GraphNodeId) As GraphLink

Parameters

sourceId
String
targetId
GraphNodeId

Returns

Applies to

GetOrCreate(GraphNodeId, String)

public:
 Microsoft::VisualStudio::GraphModel::GraphLink ^ GetOrCreate(Microsoft::VisualStudio::GraphModel::GraphNodeId ^ sourceId, System::String ^ targetId);
public Microsoft.VisualStudio.GraphModel.GraphLink GetOrCreate (Microsoft.VisualStudio.GraphModel.GraphNodeId sourceId, string targetId);
member this.GetOrCreate : Microsoft.VisualStudio.GraphModel.GraphNodeId * string -> Microsoft.VisualStudio.GraphModel.GraphLink
Public Function GetOrCreate (sourceId As GraphNodeId, targetId As String) As GraphLink

Parameters

sourceId
GraphNodeId
targetId
String

Returns

Applies to

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:
 Microsoft::VisualStudio::GraphModel::GraphLink ^ GetOrCreate(Microsoft::VisualStudio::GraphModel::GraphNodeId ^ sourceId, Microsoft::VisualStudio::GraphModel::GraphNodeId ^ targetId);
public Microsoft.VisualStudio.GraphModel.GraphLink GetOrCreate (Microsoft.VisualStudio.GraphModel.GraphNodeId sourceId, Microsoft.VisualStudio.GraphModel.GraphNodeId targetId);
member this.GetOrCreate : Microsoft.VisualStudio.GraphModel.GraphNodeId * Microsoft.VisualStudio.GraphModel.GraphNodeId -> Microsoft.VisualStudio.GraphModel.GraphLink
Public Function GetOrCreate (sourceId As GraphNodeId, targetId As GraphNodeId) As GraphLink

Parameters

sourceId
GraphNodeId

The source node

targetId
GraphNodeId

The target node

Returns

The Link that was found or created

Applies to

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:
 Microsoft::VisualStudio::GraphModel::GraphLink ^ GetOrCreate(System::String ^ sourceId, System::String ^ targetId);
public Microsoft.VisualStudio.GraphModel.GraphLink GetOrCreate (string sourceId, string targetId);
member this.GetOrCreate : string * string -> Microsoft.VisualStudio.GraphModel.GraphLink
Public Function GetOrCreate (sourceId As String, targetId As String) As GraphLink

Parameters

sourceId
String

The source node

targetId
String

The target node

Returns

The Link that was found or created

Applies to