Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
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)
Syntax
'Declaration
Public Function GetOrCreate ( _
    id As GraphNodeId, _
    label As String, _
    category As GraphCategory _
) As GraphNode
public GraphNode GetOrCreate(
    GraphNodeId id,
    string label,
    GraphCategory category
)
public:
GraphNode^ GetOrCreate(
    GraphNodeId^ id, 
    String^ label, 
    GraphCategory^ category
)
member GetOrCreate : 
        id:GraphNodeId * 
        label:string * 
        category:GraphCategory -> GraphNode
public function GetOrCreate(
    id : GraphNodeId, 
    label : String, 
    category : GraphCategory
) : GraphNode
Parameters
- id 
 Type: Microsoft.VisualStudio.GraphModel.GraphNodeId- The Id of the node 
- label 
 Type: System.String- The displayable label of the node 
- category 
 Type: Microsoft.VisualStudio.GraphModel.GraphCategory- An initial category to add to the node 
Return Value
Type: Microsoft.VisualStudio.GraphModel.GraphNode
The Node that was found or created
Exceptions
| Exception | Condition | 
|---|---|
| InvalidOperationException | Thrown if a node with same id already exists, but is of a different node type | 
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.