/// <summary> /// Indicates whether a node should be visited. /// </summary> /// <param name="node">The node to evaluate.</param> /// <param name="currentPath">The path of the node to evaluate.</param> /// <returns>True if the node should be visited, False otherwise.</returns> protected virtual bool ShouldVisitNode(IGraphNode node, GraphNodePath currentPath) { return(!visitedNodes.Contains(node) && (ShouldVisit?.Invoke(node, currentPath) ?? true)); }
/// <summary> /// Indicates whether a node should be visited. /// </summary> /// <param name="memberContent">The member content referencing the node to evaluate.</param> /// <param name="targetNode">The node to evaluate. Can be the node holding the <paramref name="memberContent"/>, or one of its target node if this node contains a reference.</param> /// <returns>True if the node should be visited, False otherwise.</returns> protected virtual bool ShouldVisitNode(IMemberNode memberContent, IContentNode targetNode) { return(!visitedNodes.Contains(targetNode) && (ShouldVisit?.Invoke(memberContent, targetNode) ?? true)); }