private bool addEdge(string nodeName1, string nodeName2, int length) { nodeName1 = nodeName1.Trim(); nodeName2 = nodeName2.Trim(); if (nodeName1 == nodeName2) { return(false); } City node1 = m_fdgGraph.GetNode(nodeName1); City node2 = m_fdgGraph.GetNode(nodeName2); string label = nodeName1 + "-" + nodeName2; var gridLine = new GridLine(0, 0, 0, 0); Connection newEdge = m_fdgGraph.CreateEdge(node1, node2, length, label, gridLine); m_fdgRenderer.Lines[newEdge] = gridLine; lbEdge.Items.Add(label); return(true); }
public Connection CreateEdge(City iSource, City iTarget, int length, string label, GridLine gridLine) { var connection = base.CreateEdge(iSource, iTarget, length, label); ConnectionsWithGridLines.Add(connection, gridLine); return(connection); }