Metodo GraphLinkCollection.GetOrCreate (GraphNodeId, GraphNodeId, String, GraphCategory)

Tenta di ottenere il collegamento con l'origine e la destinazione specificate.

Se non viene trovato, verrà creato un nuovo collegamento.

Aggiunge la categoria specificata se non è già definito.

Crea anche il nodo di origine e di destinazione se non sono già definiti (i nodi vengono creati senza categoria).

Spazio dei nomi:  Microsoft.VisualStudio.GraphModel
Assembly:  Microsoft.VisualStudio.GraphModel (in Microsoft.VisualStudio.GraphModel.dll)

Sintassi

'Dichiarazione
Public Function GetOrCreate ( _
    sourceId As GraphNodeId, _
    targetId As GraphNodeId, _
    label As String, _
    category As GraphCategory _
) As GraphLink
public GraphLink GetOrCreate(
    GraphNodeId sourceId,
    GraphNodeId targetId,
    string label,
    GraphCategory category
)
public:
GraphLink^ GetOrCreate(
    GraphNodeId^ sourceId, 
    GraphNodeId^ targetId, 
    String^ label, 
    GraphCategory^ category
)
member GetOrCreate : 
        sourceId:GraphNodeId * 
        targetId:GraphNodeId * 
        label:string * 
        category:GraphCategory -> GraphLink 
public function GetOrCreate(
    sourceId : GraphNodeId, 
    targetId : GraphNodeId, 
    label : String, 
    category : GraphCategory
) : GraphLink

Parametri

  • label
    Tipo: System.String
    L'etichetta quantità di collegamento

Valore restituito

Tipo: Microsoft.VisualStudio.GraphModel.GraphLink
Il collegamento che è stato trovato o creato

Eccezioni

Eccezione Condizione
ArgumentNullException

viene generato il sourceId o il targetId stringa è null o vuota

Sicurezza di .NET Framework

Vedere anche

Riferimenti

GraphLinkCollection Classe

Overload GetOrCreate

Spazio dei nomi Microsoft.VisualStudio.GraphModel