Partilhar via


GraphNode.FindFirstRelatedNode Method

Definition

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 doesn't exist.

public:
 Microsoft::VisualStudio::GraphModel::GraphNode ^ FindFirstRelatedNode(Microsoft::VisualStudio::GraphModel::GraphSearchDirection searchDirection, Predicate<Microsoft::VisualStudio::GraphModel::GraphLink ^> ^ traverseLink, Predicate<Microsoft::VisualStudio::GraphModel::GraphNode ^> ^ traverseNode, Predicate<Microsoft::VisualStudio::GraphModel::GraphNode ^> ^ acceptNode);
public Microsoft.VisualStudio.GraphModel.GraphNode FindFirstRelatedNode (Microsoft.VisualStudio.GraphModel.GraphSearchDirection searchDirection, Predicate<Microsoft.VisualStudio.GraphModel.GraphLink> traverseLink, Predicate<Microsoft.VisualStudio.GraphModel.GraphNode> traverseNode, Predicate<Microsoft.VisualStudio.GraphModel.GraphNode> acceptNode);
member this.FindFirstRelatedNode : Microsoft.VisualStudio.GraphModel.GraphSearchDirection * Predicate<Microsoft.VisualStudio.GraphModel.GraphLink> * Predicate<Microsoft.VisualStudio.GraphModel.GraphNode> * Predicate<Microsoft.VisualStudio.GraphModel.GraphNode> -> Microsoft.VisualStudio.GraphModel.GraphNode
Public Function FindFirstRelatedNode (searchDirection As GraphSearchDirection, traverseLink As Predicate(Of GraphLink), traverseNode As Predicate(Of GraphNode), acceptNode As Predicate(Of GraphNode)) As GraphNode

Parameters

searchDirection
GraphSearchDirection

Pass Source to search nodes that link to this node. Pass Target to search nodes that are linked from this node

traverseLink
Predicate<GraphLink>

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

traverseNode
Predicate<GraphNode>

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

acceptNode
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

Returns

The related node if found, null otherwise

Applies to