private GraphvizEdge AddEdgeIfNotExist(string from, string to, GraphvizEdge.EdgeDir dir) { GraphvizEdge edge = DotModel.FindEdge(from, to); if (edge == null) { edge = new GraphvizEdge(from, to); DotModel.Add(edge); } edge.Dir = dir; return(edge); }
private void ProcessEdge(GraphvizTableRow row) { string edges = row[0].Value; GraphvizEdge.EdgeDir dir = ToDir(edges); var nodes = edges.Split(new string[] { "<->", "->", "--" }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < nodes.Length - 1; i++) { string from = nodes[i].Trim(); string to = nodes[i + 1].Trim(); if (!string.IsNullOrEmpty(from) && !string.IsNullOrEmpty(to)) { GraphvizEdge edge = AddEdgeIfNotExist(from, to, dir); ProcessEdgeAttributes(row, edge); } } }