示例#1
0
        protected virtual void OnNodeMouseDoubleClick(VirtualTreeNodeMouseClickEventArgs e)
        {
            EventHandler <VirtualTreeNodeMouseClickEventArgs> handler = NodeMouseDoubleClick;

            if (handler != null)
            {
                handler(this, e);
            }
        }
示例#2
0
        // In the expected items, represent a separator by a null
        protected void VerifyContextMenu(object ixmo, ExpectedMenuItem[] expectedItems)
        {
            string ixmoString = (ixmo == null ? "XenCenter node" : ixmo.ToString());
            Assert.IsTrue(SelectInTree(ixmo), "Couldn't find a node for " + ixmoString + " in the tree");

            MW(() =>
                {
                    var tree = TestUtils.GetFlickerFreeTreeView(MainWindowWrapper.Item, "navigationPane.navigationView.treeView");
                    // Generate the TreeContextMenu
                    var e = new VirtualTreeNodeMouseClickEventArgs(tree.SelectedNode, MouseButtons.Right, 1, 0, 0);
                    var view = TestUtils.GetNavigationView(MainWindowWrapper.Item, "navigationPane.navigationView");
                    TestUtils.ExecuteMethod(view, "HandleNodeRightClick", new object[] { e });
                });
            var menu = TestUtils.GetContextMenuStrip(MainWindowWrapper.Item, "navigationPane.navigationView.TreeContextMenu");

            AssertToolStripItems(ixmoString, expectedItems, menu.Items, true);

            // Close the menu again
            MW(menu.Close);
            Thread.Sleep(100);
        }
示例#3
0
 private void treeView_NodeMouseDoubleClick(object sender, VirtualTreeNodeMouseClickEventArgs e)
 {
     if (okButton.Enabled)
         okButton_Click(sender, null);
 }
示例#4
0
        private void treeView_NodeMouseClick(object sender, VirtualTreeNodeMouseClickEventArgs e)
        {
            if (e.Button != MouseButtons.Right || e.Node == null)
                return;

            Folder folder = e.Node.Tag as Folder;
            if (folder == null)
                return;

            ContextMenuStrip menu = new ContextMenuStrip();
            ToolStripMenuItem item = new ToolStripMenuItem(Messages.NEW_FOLDER, Resources._000_Folder_open_h32bit_16, newMenuItem_Click);
            item.Tag = folder;
            menu.Items.Add(item);
            menu.Show(treeView, e.Location);
        }
示例#5
0
        protected virtual void OnNodeMouseDoubleClick(VirtualTreeNodeMouseClickEventArgs e)
        {
            EventHandler<VirtualTreeNodeMouseClickEventArgs> handler = NodeMouseDoubleClick;

            if (handler != null)
            {
                handler(this, e);
            }
        }
示例#6
0
        // In the expected items, represent a separator by a null
        protected void VerifyContextMenu(object ixmo, ExpectedMenuItem[] expectedItems)
        {
            string ixmoString = (ixmo == null ? "XenCenter node" : ixmo.ToString());

            // The easiest way to generate the context menu is to call TreeView_NodeMouseClick_ ourselves.
            // So construct fake click event data.
            VirtualTreeNode node = FindInTree(ixmo);
            Assert.IsNotNull(node, "Couldn't find a node for " + ixmoString + " in the tree");
            VirtualTreeNodeMouseClickEventArgs e = new VirtualTreeNodeMouseClickEventArgs(node, MouseButtons.Right, 1, 0, 0);

            // Generate the TreeContextMenu

            MW(delegate()
            {
                node.EnsureVisible();
                MainWindowWrapper.TreeView_NodeMouseClick_(MainWindowWrapper.TreeView, e);
            });
            ContextMenuStrip menu = MainWindowWrapper.TreeContextMenu;

            AssertToolStripItems(ixmoString, expectedItems, menu.Items, true);

            // Close the menu again
            MW(menu.Close);
            Thread.Sleep(100);
        }