Ejemplo n.º 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);
         }
     }
 }
Ejemplo n.º 2
0
      public void AddEdge(node_view from_node, node_view to_node)
      {
          bool isExist = false;

          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();
          }
      }