Ejemplo n.º 1
0
 private void DrawButton_Click(object sender, System.EventArgs e)
 {
     if (_listOfTransformCheckBoxs.FirstOrDefault(t => t.Checked) != null)
     {
         _graphicObject = _transformHandler.Transform(_graphicObject);
         DrawShapeHandler.DrawObject(_graphicObject, Canvas);
     }
     DrawShapeHandler.DrawObject(_graphicObject, Canvas);
 }
Ejemplo n.º 2
0
        private void Canvas_MouseDown(object sender, MouseEventArgs e)
        {
            Dictionary <string, double> eventDictionary = new Dictionary <string, double>
            {
                ["X"] = e.X,
                ["Y"] = e.Y
            };

            _transformHandler.HandleCanvasClickEvent(eventDictionary);

            if (_listOfTransformCheckBoxs.FirstOrDefault(t => t.Checked) != Mirror)
            {
                return;
            }
            GraphicObject transformedGraphicObject = _transformHandler.Transform(_graphicObject);

            DrawShapeHandler.DrawObject(transformedGraphicObject, Canvas);
        }
Ejemplo n.º 3
0
        private void Canvas_MouseMove(object sender, MouseEventArgs e)
        {
            if (e.Button != MouseButtons.Left)
            {
                return;
            }
            Dictionary <string, double> eventDictionary = new Dictionary <string, double>
            {
                ["X"] = e.X,
                ["Y"] = e.Y
            };

            _transformHandler.HandleCanvasClickEvent(eventDictionary);

            if (_listOfTransformCheckBoxs.FirstOrDefault(t => t.Checked) != null)
            {
                GraphicObject transformedGraphicObject = _transformHandler.Transform(_graphicObject);
                DrawShapeHandler.DrawObject(transformedGraphicObject, Canvas);
            }
            else
            {
                DrawShapeHandler.DrawObject(_graphicObject, Canvas);
            }
        }