public void OnFwRightMouseClick(SimpleRootSite sender, FwRightMouseClickEventArgs e) { CheckDisposed(); var browseView = sender as XmlBrowseView; if (browseView != null) { IVwSelection sel = e.Selection; int clev = sel.CLevels(false); // anchor int hvoRoot, tag, ihvo, cpropPrevious; IVwPropertyStore vps; sel.PropInfo(false, clev - 1, out hvoRoot, out tag, out ihvo, out cpropPrevious, out vps); // First make the selection so it will be highlighted before the context menu popup. if (browseView.SelectedIndex != ihvo) // No sense in waking up the beast for no reason. { browseView.SelectedIndex = ihvo; } int hvo = browseView.HvoAt(ihvo); if (Cache.ServiceLocator.IsValidObjectId(hvo)) // may be fake one from decorator. { CmObjectUi ui = CmObjectUi.MakeUi(Cache, hvo); // Disposes of itself when menu closes since true passed in lext line. if (ui != null) { ui.Mediator = m_mediator; ui.PropTable = m_propertyTable; e.EventHandled = ui.HandleRightClick(m_mediator, m_propertyTable, sender, true, "mnuBrowseView"); } } } }
public void OnFwRightMouseClick(SimpleRootSite sender, FwRightMouseClickEventArgs e) { CheckDisposed(); XmlBrowseView browseView = sender as XmlBrowseView; if (browseView != null) { IVwSelection sel = e.Selection; int clev = sel.CLevels(false); // anchor int hvoRoot, tag, ihvo, cpropPrevious; IVwPropertyStore vps; sel.PropInfo(false, clev - 1, out hvoRoot, out tag, out ihvo, out cpropPrevious, out vps); // First make the selection so it will be highlighted before the context menu popup. if (browseView.SelectedIndex != ihvo) // No sense in waking up the beast for no reason. { browseView.SelectedIndex = ihvo; } int hvo = browseView.HvoAt(ihvo); CmObjectUi ui = CmObjectUi.MakeUi(Cache, hvo); if (ui != null) { e.EventHandled = ui.HandleRightClick(m_mediator, sender, true, "mnuBrowseView"); } } }
void HandleRightMouseClickedEvent(SimpleRootSite sender, FwRightMouseClickEventArgs e) { string sMenu = XmlUtils.GetOptionalAttributeValue(this.ConfigurationNode, "contextMenu"); if (String.IsNullOrEmpty(sMenu)) { return; } e.EventHandled = true; e.Selection.Install(); XWindow xwind = (XWindow)this.Mediator.PropertyTable.GetValue("window"); xwind.ShowContextMenu(sMenu, new Point(Cursor.Position.X, Cursor.Position.Y), null, null); }