Example #1
0
 public void DeleteEdge(edge_view line)
 {
     if (edgeList.Contains(line))
     {
         edgeList.Remove(line);
         foreach (Shape shape in line.Edge)
             canvas.Children.Remove(shape);
     }
 }
Example #2
0
 public void AddEdge(int index_from, int index_to)
 {
     bool isExist = false;
     node_view from_node = TopList[index_from];
     node_view to_node = TopList[index_to];
     foreach (edge_view line0 in edgeList)
         if ((line0.From == from_node && line0.To == to_node) || (line0.To == from_node && line0.From == to_node))
         {
             MessageBox.Show("Дуга вже існує");
             isExist = true;
         }
     if (!isExist)
     {
         edge_view line = new edge_view(this, from_node, to_node);
         edgeList.Add(line);
         FirstTop = null;
         EndAddEdge();
     }
 }