void DesignerPanel_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
 {
     IUISelectionService selectionServ = this.DesignedControl.Site.GetService (typeof (IUISelectionService)) as IUISelectionService;
     if (_mouseDown)
     {
         if (selectionServ != null)
             selectionServ.MouseDragEnd (false);
         _mouseDown = false;
     }
     else if (selectionServ.SelectionInProgress)
     {
         selectionServ.MouseDragEnd (false);
     }
 }
Example #2
0
        protected override void OnMouseDragEnd(bool cancel)
        {
            IUISelectionService selectionServ = this.GetService(typeof(IUISelectionService)) as IUISelectionService;

            if (selectionServ != null)
            {
                if (selectionServ.SelectionInProgress || selectionServ.ResizeInProgress)
                {
                    selectionServ.MouseDragEnd(cancel);
                }
            }
        }
Example #3
0
        internal virtual void OnMouseUp()
        {
            IUISelectionService uiSelection = this.GetService(typeof(IUISelectionService)) as IUISelectionService;

            if (_mouseDown)
            {
                this.OnMouseDragEnd(false);
                if (uiSelection != null && (uiSelection.SelectionInProgress || uiSelection.ResizeInProgress))
                {
                    uiSelection.MouseDragEnd(false);
                }
                _mouseDown = false;
            }
            else
            {
                if (uiSelection != null && (uiSelection.SelectionInProgress || uiSelection.ResizeInProgress))
                {
                    // If the mouse up happens over the a control which is not defacto participating in
                    // the selection or resizing in progress, then inform the IUISelectionService of that event
                    //
                    uiSelection.MouseDragEnd(false);
                }
            }
        }
Example #4
0
        protected override void OnMouseDragEnd(bool cancel)
        {
            IUISelectionService selectionServ = this.GetService(typeof(IUISelectionService)) as IUISelectionService;

            if (selectionServ != null)
            {
                // If there is a Toolbox component seleted then create it instead of finishing the selection
                IToolboxService toolBoxService = this.GetService(typeof(IToolboxService)) as IToolboxService;
                if (!cancel && toolBoxService != null && toolBoxService.GetSelectedToolboxItem() != null)
                {
                    if (selectionServ.SelectionInProgress)
                    {
                        bool hasSize = selectionServ.SelectionBounds.Width > 0 &&
                                       selectionServ.SelectionBounds.Height > 0;
                        CreateToolCore(toolBoxService.GetSelectedToolboxItem(),
                                       selectionServ.SelectionBounds.X,
                                       selectionServ.SelectionBounds.Y,
                                       selectionServ.SelectionBounds.Width,
                                       selectionServ.SelectionBounds.Height,
                                       true, hasSize);
                        toolBoxService.SelectedToolboxItemUsed();
                        cancel = true;
                    }
                    else if (!selectionServ.SelectionInProgress &&
                             !selectionServ.ResizeInProgress && !selectionServ.DragDropInProgress)
                    {
                        CreateTool(toolBoxService.GetSelectedToolboxItem(), _mouseDownPoint);
                        toolBoxService.SelectedToolboxItemUsed();
                        cancel = true;
                    }
                }

                if (selectionServ.SelectionInProgress || selectionServ.ResizeInProgress)
                {
                    selectionServ.MouseDragEnd(cancel);
                }
            }
        }