GraphNodeCollection::GetOrCreate Method (String^, String^, GraphCategory^)

 

Attempts to get the node with the specified id. If not found, it will create a new node.

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

public:
GraphNode^ GetOrCreate(
	String^ id,
	String^ label,
	GraphCategory^ category
)

Parameters

id
Type: System::String^

id of the node

label
Type: System::String^

displayable label of the node

category
Type: Microsoft.VisualStudio.GraphModel::GraphCategory^

category of the node

Return Value

Type: Microsoft.VisualStudio.GraphModel::GraphNode^

the node that was found or created

Exception Condition
InvalidOperationException

Thrown if a node with same id already exists, but is of a different node type

Return to top
Show: