protected override bool OnRightMouseUp(Point pt, Rectangle rcSrcRoot,
                                               Rectangle rcDstRoot)
        {
            IVwSelection sel = RootBox.MakeSelAt(pt.X, pt.Y, rcSrcRoot, rcDstRoot, false);
            TextSelInfo  tsi = new TextSelInfo(sel);

            return(HandleRightClickOnObject(tsi.Hvo(false)));
        }
Exemplo n.º 2
0
        protected override bool OnRightMouseUp(Point pt, Rectangle rcSrcRoot,
                                               Rectangle rcDstRoot)
        {
            // if we don't install the selection here, a previous selection may give us
            // spurious results later on when handling the UI this right click brings up;
            // see LT-12154.
            IVwSelection sel = RootBox.MakeSelAt(pt.X, pt.Y, rcSrcRoot, rcDstRoot, true);
            TextSelInfo  tsi = new TextSelInfo(sel);

            return(HandleRightClickOnObject(tsi.Hvo(false)));
        }
 protected override void OnMouseUp(MouseEventArgs e)
 {
     base.OnMouseUp(e);
     if (e.Button == MouseButtons.Left && (ModifierKeys & Keys.Control) == Keys.Control)
     {
         // Control-click: take the first jump-to-tool command from the right-click menu for this location.
         // Create a selection where we right clicked
         IVwSelection sel       = GetSelectionAtPoint(new Point(e.X, e.Y), false);
         TextSelInfo  tsi       = new TextSelInfo(sel);
         int          hvoTarget = tsi.Hvo(false);
         // May be (for example) dummy ID used for type-ahead object in reference vector list.
         if (hvoTarget == 0 || !Cache.ServiceLocator.IsValidObjectId(hvoTarget))
         {
             return;
         }
         using (ReferenceBaseUi ui = GetCmObjectUiForRightClickMenu(hvoTarget))
         {
             ui.HandleCtrlClick(Mediator, this);
         }
     }
 }