Example #1
0
 private void LeftMouseButtonDown(object sender, MouseButtonEventArgs e)
 {
     if (!rightButtonDown)
     {
         Edge resE = mG.PushOnEdge(e.GetPosition(graphCanvas));
         if (resE != null)
         {
             if ((bool)pInfo.btnWeight.IsChecked)
             {
                 new InputWeight(mG, e.GetPosition(graphCanvas), resE).ShowDialog();
             }
             else
             {
                 mG.RemoveEdge(resE);
             }
         }
         else
         {
             Vertex resV = mG.PushOnVertex(e.GetPosition(graphCanvas));
             if (resV == null)
             {
                 mG.AddVertex(e.GetPosition(graphCanvas));
             }
             else
             {
                 mG.RemoveVertex(e.GetPosition(graphCanvas));
             }
         }
     }
 }
Example #2
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     mGraph.RemoveEdge(edge);
     this.Close();
 }