예제 #1
0
 public void RemoveAllPointsTest()
 {
     logic = new Logic();
     MyPointCollection.addPoint(new Point(5, -5));
     MyPointCollection.addPoint(new Point(10, -5));
     MyPointCollection.addPoint(new Point(11, -52));
     MyPointCollection.addPoint(new Point(53, -25));
     MyPointCollection.addPoint(new Point(15, -33));
     logic.removeAllPoint();
     System.Collections.Generic.List <Point> list = logic.getPoints();
     Assert.AreEqual(0, list.Count);
 }
예제 #2
0
 /// <summary>
 /// Point drawing
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e">Mouse</param>
 private void Canvas_MouseDown(object sender, MouseButtonEventArgs e)
 {
     if (isDone && e.LeftButton == MouseButtonState.Pressed)
     {
         MyPointCollection.addPoint(Mouse.GetPosition(shapeCanvas));
         Ellipse el = new Ellipse
         {
             Fill   = System.Windows.Media.Brushes.Black,
             Height = 2,
             Width  = 2,
             Margin = new Thickness(Mouse.GetPosition(shapeCanvas).X, Mouse.GetPosition(shapeCanvas).Y, 0, 0)
         };
         PointEllipseColl.collection.Add(el);
         shapeCanvas.Children.Add(el);
         Action act = drawPolygon;
         logic.createAndDrawPolygon(act);
     }
 }