public HandleRightClick ( XCore.Mediator mediator, |
||
mediator | XCore.Mediator | |
hostControl | ||
shouldDisposeThisWhenClosed | bool | True, if the menu handler is to dispose of the CmObjectUi after menu closing |
Résultat | bool |
private bool HandleRightClickOnObject(int hvoDummy) { if (hvoDummy == 0) return false; if (m_realEnvs.ContainsKey(hvoDummy)) { // This displays the "Show in Environments list" item in the popup menu, in // addition to all the Insert X" items. int hvo = m_realEnvs[hvoDummy].Hvo; ReferenceCollectionUi ui = new ReferenceCollectionUi(Cache, m_rootObj, m_rootFlid, hvo); return ui.HandleRightClick(Mediator, this, true); } else { // We need a CmObjectUi in order to call HandleRightClick(). This won't // display the "Show in Environments list" item in the popup menu. CmObjectUi ui = new CmObjectUi(m_rootObj); return ui.HandleRightClick(Mediator, this, true, "mnuEnvReferenceChoices"); } }
private void ContextMenuRequested(object sender, ContextMenuRequestedEventArgs e) { e.Selection.Install(); ICmObject obj = CurrentObject; if (obj != null) { // we only bother to display the context menu if an item is selected using (var ui = new CmObjectUi(obj)) { e.Handled = ui.HandleRightClick(Mediator, this, true, ContextMenuID); } } }
public virtual bool DisplayContextMenu(IVwSelection vwselNew) { SelectionHelper sel = SelectionHelper.Create(vwselNew, m_view); int hvo = CurrentHvo; if (hvo != 0) { // we only bother to display the context menu if an item is selected CmObjectUi ui = new CmObjectUi(CmObject.CreateFromDBObject(m_cache, hvo)); return ui.HandleRightClick(Mediator, this, true, m_menuId); } else { return false; } }
public virtual bool DisplayContextMenu(IVwSelection vwselNew) { SelectionHelper sel = SelectionHelper.Create(vwselNew, m_view); var obj = CurrentObject; if (obj != null) { // we only bother to display the context menu if an item is selected using (var ui = new CmObjectUi(obj)) return ui.HandleRightClick(Mediator, this, true, ContextMenuID); } return false; }