protected virtual bool HandleRightClickOnObject(int hvo) { #if TESTMS Debug.WriteLine("Starting: ReferenceViewBase.HandleRightClickOnObject"); #endif if (hvo == 0) { #if TESTMS Debug.WriteLine("ReferenceViewBase.HandleRightClickOnObject: hvo is 0, so returning."); #endif return(false); } using (ReferenceBaseUi ui = GetCmObjectUiForRightClickMenu(hvo)) { #if TESTMS Debug.WriteLine("Created ReferenceBaseUi"); Debug.WriteLine("hvo=" + hvo.ToString() + " " + ui.Object.ShortName + " " + ui.Object.ToString()); #endif if (ui != null) { #if TESTMS Debug.WriteLine("ui.HandleRightClick: and returning true."); #endif return(ui.HandleRightClick(Mediator, this, true, CmObjectUi.MarkCtrlClickItem)); } #if TESTMS Debug.WriteLine("No ui: returning false"); #endif return(false); } }
protected virtual bool HandleRightClickOnObject(int hvo) { #if TESTMS Debug.WriteLine("Starting: ReferenceViewBase.HandleRightClickOnObject"); #endif if (hvo == 0) { #if TESTMS Debug.WriteLine("ReferenceViewBase.HandleRightClickOnObject: hvo is 0, so returning."); #endif return(false); } ReferenceBaseUi ui = ReferenceBaseUi.MakeUi(Cache, m_rootObj, m_rootFlid, hvo); #if TESTMS Debug.WriteLine("Created ReferenceBaseUi"); Debug.WriteLine("hvo=" + hvo.ToString() + " " + ui.Object.ShortName + " " + ui.Object.ToString()); #endif if (ui != null) { #if TESTMS Debug.WriteLine("ui.HandleRightClick: and returning true."); #endif return(ui.HandleRightClick(Mediator, this, true)); } #if TESTMS Debug.WriteLine("No ui: returning false"); #endif return(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); } } }
private ReferenceBaseUi GetCmObjectUiForRightClickMenu(int hvoTarget) { return(ReferenceBaseUi.MakeUi(Cache, m_rootObj, m_rootFlid, hvoTarget)); }