Exemplo n.º 1
0
        public void MapMenuItems(IEnumerable <ToolStripMenuItem> items)
        {
            foreach (ToolStripMenuItem item in items)
            {
                if (item != null && item.Tag is CommandMenuTag)
                {
                    CommandMenuTag tag = (CommandMenuTag)item.Tag;
                    MapMenuItem(tag.Key, item);
                }

                if (item.DropDownItems != null)
                {
                    MapMenuItems(item.DropDownItems);
                }
            }
        }
Exemplo n.º 2
0
        public void MapMenuItems(ToolStripItemCollection items)
        {
            foreach (ToolStripItem item in items)
            {
                ToolStripMenuItem menuItem = item as ToolStripMenuItem;
                if (menuItem != null)
                {
                    if (item != null && item.Tag is CommandMenuTag)
                    {
                        CommandMenuTag tag = (CommandMenuTag)item.Tag;
                        MapMenuItem(tag.Key, menuItem);
                    }

                    if (menuItem.DropDownItems != null)
                    {
                        MapMenuItems(menuItem.DropDownItems);
                    }
                }
            }
        }