private void FillCustomMenuItemObject(IMainMenuItem current, CustomMenuItem item) { current.Text = item.Text; current.Order = item.Order; current.Active = item.Active; current.Parent = item.Parent; }
private static void AddSubMenu(EventHandler dele, IMainMenuItem menu, ToolStripMenuItem item) { if (menu.SubMenuItems.Count > 0) { foreach (var subItem in menu.SubMenuItems) { var subMenuItem = new ToolStripMenuItem(subItem.Name); item.DropDownItems.Add(subMenuItem); if (subItem.ActivateDelegate != null) { subMenuItem.Tag = subItem; subMenuItem.Click += dele; } AddSubMenu(dele, subItem, subMenuItem); } } }
private static void CheckForChilds(IMainMenuItem menuItem, IEnumerable <IMainMenuItem> menuItemsList) { var mainMenuItems = menuItemsList as IMainMenuItem[] ?? menuItemsList.ToArray(); var childs = mainMenuItems.Where(x => x.Parent == menuItem.Name).OrderBy(x => x.Order); if (childs.Any()) { foreach (var child in childs) { menuItem.Childs.Add(child); } foreach (var child in childs) { CheckForChilds(child, mainMenuItems); } } }
public UpdateNoteList(IMainMenuItem menuItem) { MenuItem = menuItem; }