Ejemplo n.º 1
0
            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();
                }
            }
Ejemplo n.º 2
0
            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);
                }
            }