/// <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); }
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); }
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); }
private ToolStripMenuItem addRootFolder(MenuItemManager.FolderItem item) { return(createNewMenuItem(item)); }
private void isFolder(MenuItemManager.FolderItem item, int count, string name) { isFolder(item, count); Assert.AreEqual(name, item.Name); }
private void isFolder(MenuItemManager.FolderItem item, int count) { Assert.AreEqual(item.CanExpand, true); Assert.AreEqual(item.Children.Count, count); }
private void assertIsEndpoint(MenuItemManager.FolderItem item, string childName) { Assert.AreEqual(childName, item.Name); Assert.AreEqual(false, item.CanExpand); Assert.AreEqual(0, item.Children.Count); }