コード例 #1
0
        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");
                    }
                }
            }
        }
コード例 #2
0
        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");
                }
            }
        }
コード例 #3
0
ファイル: MultiStringSlice.cs プロジェクト: sillsdev/WorldPad
        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);
        }