Partager via


GraphNode.FindFirstRelatedNode Method

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Finds the first node that matches the acceptNode predicate that is also related to this node according to the traverseLink and traverseNode predicates.

It is found by doing a breadth first search along links matching the traverseLink predicate, in the To or From direction designated by the searchDirection parameter. Returns null if it does not exist.

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

Syntax

'Declaration
Public Function FindFirstRelatedNode ( _
    searchDirection As GraphSearchDirection, _
    traverseLink As Predicate(Of GraphLink), _
    traverseNode As Predicate(Of GraphNode), _
    acceptNode As Predicate(Of GraphNode) _
) As GraphNode
public GraphNode FindFirstRelatedNode(
    GraphSearchDirection searchDirection,
    Predicate<GraphLink> traverseLink,
    Predicate<GraphNode> traverseNode,
    Predicate<GraphNode> acceptNode
)
public:
GraphNode^ FindFirstRelatedNode(
    GraphSearchDirection searchDirection, 
    Predicate<GraphLink^>^ traverseLink, 
    Predicate<GraphNode^>^ traverseNode, 
    Predicate<GraphNode^>^ acceptNode
)
member FindFirstRelatedNode : 
        searchDirection:GraphSearchDirection * 
        traverseLink:Predicate<GraphLink> * 
        traverseNode:Predicate<GraphNode> * 
        acceptNode:Predicate<GraphNode> -> GraphNode
public function FindFirstRelatedNode(
    searchDirection : GraphSearchDirection, 
    traverseLink : Predicate<GraphLink>, 
    traverseNode : Predicate<GraphNode>, 
    acceptNode : Predicate<GraphNode>
) : GraphNode

Parameters

  • traverseLink
    Type: System.Predicate<GraphLink>

    A predicate function to control link traversal behavior, pass null if you want to traverse all links

  • traverseNode
    Type: System.Predicate<GraphNode>

    A predicate to control node traversal behavior, pass null if you want to traverse all reachable nodes

  • acceptNode
    Type: System.Predicate<GraphNode>

    A predicate to control if a node is to be included in the search or not, pass null if you want to accept all nodes

Return Value

Type: Microsoft.VisualStudio.GraphModel.GraphNode
The related node if found, null otherwise

.NET Framework Security

See Also

Reference

GraphNode Class

Microsoft.VisualStudio.GraphModel Namespace