Exemple #1
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");
                }
            }
        }
Exemple #2
0
        public void DoubleClickEmptyItem()
        {
            using (var bv = new XmlBrowseView())
            {
                var xdoc = new XmlDocument();
                // Largely copied from a live one. We probably don't really need all these for this test.
                xdoc.LoadXml(@"<parameters id='textsChooser' clerk='interlinearTexts' filterBar='true' treeBarAvailability='NotAllowed'
						defaultCursor='Arrow' altTitleId='Text-Plural' editable='false'>
						<columns>
							<column label='Title' width='144000'><string field='Title' ws='$ws=best vernoranal' /></column>
						</columns>
					</parameters>"                    );
                using (var mediator = new Mediator())
                {
                    bv.Init(mediator, xdoc.DocumentElement);
                    bv.SimulateDoubleClick(new EventArgs());
                }
            }
        }