示例#1
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are ignored unless the option to convert to C# 7.2 'in' parameters is selected:
//ORIGINAL LINE: private org.neo4j.graphdb.traversal.Traverser traverseToDepth(org.neo4j.graphdb.GraphDatabaseService graphDb, final org.neo4j.graphdb.Node startNode, final int depth)
        private Traverser TraverseToDepth(GraphDatabaseService graphDb, Node startNode, int depth)
        {
            TraversalDescription traversalDescription = graphDb.TraversalDescription().expand(PathExpanders.allTypesAndDirections()).depthFirst().evaluator(path =>
            {
                if (path.length() < depth)
                {
                    return(Evaluation.INCLUDE_AND_CONTINUE);
                }
                else
                {
                    return(Evaluation.INCLUDE_AND_PRUNE);
                }
            });

            return(traversalDescription.Traverse(startNode));
        }