Example #1
0
        /// <summary>
        /// Обработчик нажатия мышки
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button != MouseButtons.Left)
            {
                return;
            }
            var circle = FigureFactory.CreateFillableFigure(ToolType.Circle) as FillableFigure;

            if (circle != null)
            {
                circle.LineProperties.Color     = _figureParameters.LineColor;
                circle.LineProperties.Style     = (DashStyle)_figureParameters.LineStyle;
                circle.LineProperties.Thickness = _figureParameters.LineThickness;
                circle.FillProperty.FillColor   = _figureParameters.FillColor;

                _circle = circle;
            }

            _circle.Points.AddPoint(new PointF(e.X, e.Y));
            _circle.Points.AddPoint(new PointF(e.X, e.Y));

            Canvas.Refresh();
        }