Exemplo n.º 1
0
        protected override void OnMouseUp(MouseButtonEventArgs e)
        {
            base.OnMouseUp(e);
            var type = dragType;

            dragType = DragEndPoint.Unknown;
            ReleaseMouseCapture();
            if (null != snappedSocket)
            {
                if (DragEndPoint.Input == type)
                {
                    ConnectInputEndPoint(snappedSocket);
                }
                else
                {
                    ConnectOutputEndPoint(snappedSocket);
                }
            }
            if (null == inputSocket || null == outputSocket)
            {
                Delete();
            }
            snappedSocket = null;
            e.Handled     = true;
        }
Exemplo n.º 2
0
 private void BeginDrag(MouseButtonEventArgs e, DragEndPoint endPoint)
 {
     if (null == root) return;
     if (MouseButton.Left != e.ChangedButton) return;
     CaptureMouse();
     dragType = endPoint;
     dragInit = (Point)(e.GetPosition(root) - (dragType == DragEndPoint.Input ? StartPoint : StopPoint));
     e.Handled = true;
 }
Exemplo n.º 3
0
 private void BeginDrag(MouseButtonEventArgs e, DragEndPoint endPoint)
 {
     if (null == root)
     {
         return;
     }
     if (MouseButton.Left != e.ChangedButton)
     {
         return;
     }
     CaptureMouse();
     dragType  = endPoint;
     dragInit  = (Point)(e.GetPosition(root) - (dragType == DragEndPoint.Input ? StartPoint : StopPoint));
     e.Handled = true;
 }
Exemplo n.º 4
0
 protected override void OnMouseUp(MouseButtonEventArgs e)
 {
     base.OnMouseUp(e);
     var type = dragType;
     dragType = DragEndPoint.Unknown;
     ReleaseMouseCapture();
     if (null != snappedSocket)
     {
         if (DragEndPoint.Input == type)
             ConnectInputEndPoint(snappedSocket);
         else
             ConnectOutputEndPoint(snappedSocket);
     }
     if (null == inputSocket || null == outputSocket)
         Delete();
     snappedSocket = null;
     e.Handled = true;
 }