public override void Show(FigureBase figure)
        {
            Shape shape = null;

            switch (figure.ToString())
            {
            case "Circle":
                shape = CreateCircle();
                break;

            case "Rectangle":
                shape = CreateRectangle();
                break;

            case "Triangle":
                throw new Exception("No implementation of triangle drawing. Please make it.");
            }

            Canvas.SetLeft(shape, _mouseButtonEventArgs.GetPosition(_context.Canvas).X);
            Canvas.SetTop(shape, _mouseButtonEventArgs.GetPosition(_context.Canvas).Y);

            _context.Canvas.Children.Add(shape);
        }
Beispiel #2
0
 public override void Show(FigureBase figure)
 {
     MessageBox.Show(figure.ToString(), "caption", MessageBoxButton.OK);
 }