internal static void AddEdge(AdlibNode source, AdlibEdgeType type, AdlibNode target) { var edge = new AdlibEdge(source, type, target); AddSingleEdge(source.Edges, edge); AddSingleEdge(target.ReverseEdges, edge); }
protected static void AddSingleEdge(List <AdlibEdge> edges, AdlibEdge edge) { foreach (var existingEdge in edges) { if (edge.Source == existingEdge.Source && edge.Target == existingEdge.Target && edge.EdgeType == existingEdge.EdgeType) { return; } } edges.Add(edge); }
XElement CreateDGMLLink(AdlibEdge edge) { var element = new XElement(dgmlNS + "Link", new XAttribute("Source", edge.Source.Path), new XAttribute("Target", edge.Target.Path), new XAttribute("Label", edge.EdgeType) ); if (edge.Traversed) { element.Add(new XAttribute("Category", "Traversed")); } return(element); }