GraphNode::FindFirstRelatedNode Method (GraphSearchDirection, Predicate<GraphLink^>^, Predicate<GraphNode^>^, Predicate<GraphNode^>^)

 

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)

public:
GraphNode^ FindFirstRelatedNode(
	GraphSearchDirection searchDirection,
	Predicate<GraphLink^>^ traverseLink,
	Predicate<GraphNode^>^ traverseNode,
	Predicate<GraphNode^>^ acceptNode
)

Parameters

searchDirection
Type: Microsoft.VisualStudio.GraphModel::GraphSearchDirection

Pass Source to search nodes that link to this node.

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

Return to top
Show: