Ejemplo n.º 1
0
        public override void Start(object sender)
        {
            if (sender is Canvas)
            {
                Canvas canvas        = (Canvas)sender;
                Point  mousePosition = Mouse.GetPosition(canvas);

                ShapeHolder newShapeHolder = ShapeHolderFactory.CreateShapeHolder(CanvasHolder);
                HandlePoint newHandlePoint = new HandlePoint(mousePosition, newShapeHolder);
                newShapeHolder.CreateByPoint(newHandlePoint);
                CanvasHolder.SelectHandlePoint(newHandlePoint);

                ProgressTimer.Start();
            }
        }
Ejemplo n.º 2
0
        private void Draw_OnClick(object sender, RoutedEventArgs e)
        {
            Point position1 = new Point();
            Point position2 = new Point();

            position1.X = Convert.ToDouble(tbPositionX1.Text);
            position1.Y = Convert.ToDouble(tbPositionY1.Text);
            position2.X = Convert.ToDouble(tbPositionX2.Text);
            position2.Y = Convert.ToDouble(tbPositionY2.Text);

            ShapeHolder newShapeHolder = ShapeHolderFactory.CreateShapeHolder(CanvasHolder);
            HandlePoint newHandlePoint = new HandlePoint(position1, newShapeHolder);

            newShapeHolder.CreateByPoint(newHandlePoint);
            CanvasHolder.SelectHandlePoint(newHandlePoint);

            newHandlePoint.Move(position2);
            newHandlePoint.ModifyShape();
        }
Ejemplo n.º 3
0
        public override void Start(object sender)
        {
            if (sender is Canvas)
            {
                Canvas      canvas        = (Canvas)sender;
                Point       mousePosition = Mouse.GetPosition(canvas);
                ShapeHolder shapeHolder   = CanvasHolder.ActiveShapeHolder;

                if (shapeHolder == null)
                {
                    shapeHolder = ShapeHolderFactory.CreateShapeHolder(CanvasHolder);
                    CanvasHolder.ActiveShapeHolder = shapeHolder;
                }
                HandlePoint newHandlePoint = new HandlePoint(mousePosition, shapeHolder);
                shapeHolder.CreateByPoint(newHandlePoint);

                if (shapeHolder.HandlePoints.Count > 2)
                {
                    shapeHolder.ModifyByPoint(newHandlePoint);
                }
            }
        }
        private void AddPoint_OnClick(object sender, RoutedEventArgs e)
        {
            Point position = new Point();

            position.X = Convert.ToDouble(tbPositionX.Text);
            position.Y = Convert.ToDouble(tbPositionY.Text);

            ShapeHolder shapeHolder = CanvasHolder.ActiveShapeHolder;

            if (shapeHolder == null)
            {
                shapeHolder = ShapeHolderFactory.CreateShapeHolder(CanvasHolder);
                CanvasHolder.ActiveShapeHolder = shapeHolder;
            }
            HandlePoint newHandlePoint = new HandlePoint(position, shapeHolder);

            shapeHolder.CreateByPoint(newHandlePoint);

            if (shapeHolder.HandlePoints.Count > 2)
            {
                shapeHolder.ModifyByPoint(newHandlePoint);
            }
        }