GraphNodeCollection.GetOrCreate Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
GetOrCreate(GraphNodeId) |
Attempts to get the node with the specified id. If not found, it will create a new node. |
GetOrCreate(String) |
Attempts to get the node with the specified id. If not found, it will create a new node. |
GetOrCreate(GraphNodeId, String, GraphCategory) |
Attempts to get the node with the specified id. If not found, it will create a new node. |
GetOrCreate(String, String, GraphCategory) |
Attempts to get the node with the specified id. If not found, it will create a new node. |
GetOrCreate(GraphNodeId)
Attempts to get the node with the specified id. If not found, it will create a new node.
public:
Microsoft::VisualStudio::GraphModel::GraphNode ^ GetOrCreate(Microsoft::VisualStudio::GraphModel::GraphNodeId ^ id);
public Microsoft.VisualStudio.GraphModel.GraphNode GetOrCreate (Microsoft.VisualStudio.GraphModel.GraphNodeId id);
member this.GetOrCreate : Microsoft.VisualStudio.GraphModel.GraphNodeId -> Microsoft.VisualStudio.GraphModel.GraphNode
Public Function GetOrCreate (id As GraphNodeId) As GraphNode
Parameters
- id
- GraphNodeId
The Id of the node
Returns
The Node that was found or created
Exceptions
Thrown if a node with same id already exists, but is of a different node type
Applies to
GetOrCreate(String)
Attempts to get the node with the specified id. If not found, it will create a new node.
public:
Microsoft::VisualStudio::GraphModel::GraphNode ^ GetOrCreate(System::String ^ id);
public Microsoft.VisualStudio.GraphModel.GraphNode GetOrCreate (string id);
member this.GetOrCreate : string -> Microsoft.VisualStudio.GraphModel.GraphNode
Public Function GetOrCreate (id As String) As GraphNode
Parameters
- id
- String
Id of the Node
Returns
The Node that was found or created
Exceptions
thrown if a node with same id already exists, but is of a different node type
Applies to
GetOrCreate(GraphNodeId, String, GraphCategory)
Attempts to get the node with the specified id. If not found, it will create a new node.
public:
Microsoft::VisualStudio::GraphModel::GraphNode ^ GetOrCreate(Microsoft::VisualStudio::GraphModel::GraphNodeId ^ id, System::String ^ label, Microsoft::VisualStudio::GraphModel::GraphCategory ^ category);
public Microsoft.VisualStudio.GraphModel.GraphNode GetOrCreate (Microsoft.VisualStudio.GraphModel.GraphNodeId id, string label, Microsoft.VisualStudio.GraphModel.GraphCategory category);
member this.GetOrCreate : Microsoft.VisualStudio.GraphModel.GraphNodeId * string * Microsoft.VisualStudio.GraphModel.GraphCategory -> Microsoft.VisualStudio.GraphModel.GraphNode
Public Function GetOrCreate (id As GraphNodeId, label As String, category As GraphCategory) As GraphNode
Parameters
- id
- GraphNodeId
The Id of the node
- label
- String
The displayable label of the node
- category
- GraphCategory
An initial category to add to the node
Returns
The Node that was found or created
Exceptions
Thrown if a node with same id already exists, but is of a different node type
Applies to
GetOrCreate(String, String, GraphCategory)
Attempts to get the node with the specified id. If not found, it will create a new node.
public:
Microsoft::VisualStudio::GraphModel::GraphNode ^ GetOrCreate(System::String ^ id, System::String ^ label, Microsoft::VisualStudio::GraphModel::GraphCategory ^ category);
public Microsoft.VisualStudio.GraphModel.GraphNode GetOrCreate (string id, string label, Microsoft.VisualStudio.GraphModel.GraphCategory category);
member this.GetOrCreate : string * string * Microsoft.VisualStudio.GraphModel.GraphCategory -> Microsoft.VisualStudio.GraphModel.GraphNode
Public Function GetOrCreate (id As String, label As String, category As GraphCategory) As GraphNode
Parameters
- id
- String
The Id of the node
- label
- String
The displayable label of the node
- category
- GraphCategory
An initial category to add to the node
Returns
The Node that was found or created
Exceptions
Thrown if a node with same id already exists, but is of a different node type