コード例 #1
0
        /// <summary>
        /// Adds a new item to the existing item and returns the new item.
        /// </summary>
        /// <param name="item"></param>
        /// <param name="addTo"></param>
        /// <returns></returns>
        private ToolStripMenuItem addFolder(MenuItemManager.FolderItem item, ToolStripMenuItem addTo)
        {
            var toAdd = createNewMenuItem(item);

            addTo.DropDownItems.Add(toAdd);
            return(toAdd);
        }
コード例 #2
0
        private void addItem(MenuItemManager.FolderItem item, ToolStripMenuItem addTo)
        {
            var added = new ToolStripMenuItem(item.Name);

            added.CheckOnClick = true;
            added.Click       += (o, ea) => { item.Execute(); };
            addTo.DropDownItems.Add(added);
        }
コード例 #3
0
        private ToolStripMenuItem createNewMenuItem(MenuItemManager.FolderItem item)
        {
            ToolStripMenuItem itemToAdd = new ToolStripMenuItem();

            //itemToAdd.Name = "testToolStripMenuItem";
            itemToAdd.Size = new System.Drawing.Size(defaultFirstSize, defaultSecondSize);
            itemToAdd.Text = item.Name;
            return(itemToAdd);
        }
コード例 #4
0
 private ToolStripMenuItem addRootFolder(MenuItemManager.FolderItem item)
 {
     return(createNewMenuItem(item));
 }
コード例 #5
0
 private void isFolder(MenuItemManager.FolderItem item, int count, string name)
 {
     isFolder(item, count);
     Assert.AreEqual(name, item.Name);
 }
コード例 #6
0
 private void isFolder(MenuItemManager.FolderItem item, int count)
 {
     Assert.AreEqual(item.CanExpand, true);
     Assert.AreEqual(item.Children.Count, count);
 }
コード例 #7
0
 private void assertIsEndpoint(MenuItemManager.FolderItem item, string childName)
 {
     Assert.AreEqual(childName, item.Name);
     Assert.AreEqual(false, item.CanExpand);
     Assert.AreEqual(0, item.Children.Count);
 }