GraphLinkCollection::GetOrCreate Method (GraphNodeId^, GraphNodeId^, String^, GraphCategory^)
Visual Studio 2015
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).
Assembly: Microsoft.VisualStudio.GraphModel (in Microsoft.VisualStudio.GraphModel.dll)
public:
GraphLink^ GetOrCreate(
GraphNodeId^ sourceId,
GraphNodeId^ targetId,
String^ label,
GraphCategory^ category
)
Parameters
- sourceId
-
Type:
Microsoft.VisualStudio.GraphModel::GraphNodeId^
The source node
- targetId
-
Type:
Microsoft.VisualStudio.GraphModel::GraphNodeId^
The target node
- label
-
Type:
System::String^
The displayable label of the link
- category
-
Type:
Microsoft.VisualStudio.GraphModel::GraphCategory^
An initial category to add to this link
| Exception | Condition |
|---|---|
| ArgumentNullException | thrown is sourceId or targetId is null or empty string |
Show: