static private IVertexBase GetNextVertex(IEdgeBase edge, GraphDirection direction) { switch (direction) { case GraphDirection.Successors: return(edge.End); case GraphDirection.Predecessors: return(edge.Start); default: throw new NotSupportedException(); } }
public IEnumerable <Projection <TValue> > Visit(IEdgeBase edge, Arguments args, GraphDirection direction) { args = new Arguments(args); args.Value = Transform(edge, args.Value, direction); IVertexBase nextVertex = GetNextVertex(edge, direction); foreach (Projection <TValue> projection in nextVertex.Accept(this, args)) { yield return(projection); } }