Exemple #1
0
 protected override void OnMouseUp(object sender, MouseButtonEventArgs e)
 {
     if (!hasDragStarted)
     {
         if (isDoubleClick)
         {
             // user made a double-click
             Debug.Assert(moveLogic.Operation == null);
             moveLogic.HandleDoubleClick();
         }
         else if (setSelectionIfNotMoving)
         {
             services.Selection.SetSelectedComponents(new DesignItem[] { moveLogic.ClickedOn },
                                                      SelectionTypes.Auto);
         }
     }
     moveLogic.Stop();
     Stop();
 }
        void designPanel_Drop(object sender, DragEventArgs e)
        {
            try
            {
                if (moveLogic != null)
                {
                    moveLogic.Stop();
                    if (moveLogic.ClickedOn.Services.Tool.CurrentTool is CreateComponentTool)
                    {
                        moveLogic.ClickedOn.Services.Tool.CurrentTool = moveLogic.ClickedOn.Services.Tool.PointerTool;
                    }
                    moveLogic.DesignPanel.IsAdornerLayerHitTestVisible = true;
                    moveLogic = null;
                    changeGroup.Commit();

                    e.Handled = true;
                }
            }
            catch (Exception x)
            {
                DragDropExceptionHandler.RaiseUnhandledException(x);
            }
        }