Пример #1
0
 private void FillCustomMenuItemObject(IMainMenuItem current, CustomMenuItem item)
 {
     current.Text   = item.Text;
     current.Order  = item.Order;
     current.Active = item.Active;
     current.Parent = item.Parent;
 }
Пример #2
0
 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);
         }
     }
 }
Пример #3
0
        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);
                }
            }
        }
Пример #4
0
 public UpdateNoteList(IMainMenuItem menuItem)
 {
     MenuItem = menuItem;
 }