[NotNull] public IEnumerable <DirectedGraphEdge <T> > GetEdgesTo([NotNull] DirectedGraphNode <T> node) { if (node == null) { throw new ArgumentNullException(nameof(node)); } if (!mEdgesToView.ContainsKey(node.Data)) { yield break; } foreach (var sourceNode in mEdgesToView[node.Data]) { yield return(new DirectedGraphEdge <T>(this, sourceNode, node)); } }
internal DirectedGraphEdge([NotNull] DirectedGraph <T> graph, [NotNull] T from, [NotNull] T to) { if (graph == null) { throw new ArgumentNullException(nameof(graph)); } if (from == null) { throw new ArgumentNullException(nameof(from)); } if (to == null) { throw new ArgumentNullException(nameof(to)); } From = new DirectedGraphNode <T>(graph, from); To = new DirectedGraphNode <T>(graph, to); }