private void ShortcutComboBox_SelectedIndexChanged(object sender, EventArgs e) { if (HandleSelectedItemChanged && MenuTree.SelectedNode != null && ShortcutComboBox.SelectedItem != null) { NuGenMenuItemShortcut menuItemShortcut = (NuGenMenuItemShortcut)MenuTree.SelectedNode.Tag; menuItemShortcut.UpdateShortcut(NuGenShortcutConverter.ConvertStringToShortcut((string)ShortcutComboBox.SelectedItem)); MenuTree.SelectedNode.Text = menuItemShortcut.GetText(); } }
private void AddMenuTreeNodes(TreeNodeCollection nodes, Menu.MenuItemCollection menuItems) { for (int index = 0; index < menuItems.Count; index++) { MenuItem menuItem = menuItems[index]; if (menuItem.Tag != null || (menuItem.MenuItems != null && menuItem.MenuItems.Count > 0)) { NuGenMenuItemShortcut menuItemShortcut = new NuGenMenuItemShortcut(menuItem); TreeNode node = nodes.Add(menuItemShortcut.GetText()); node.Tag = menuItemShortcut; if (menuItem.MenuItems != null && menuItem.MenuItems.Count > 0) { AddMenuTreeNodes(node.Nodes, menuItem.MenuItems); } } } }
private void AddMenuTreeNodes(TreeNodeCollection nodes, Menu.MenuItemCollection menuItems) { for (int index = 0; index < menuItems.Count; index++) { MenuItem menuItem = menuItems[index]; if (menuItem.Tag != null || (menuItem.MenuItems != null && menuItem.MenuItems.Count > 0)) { NuGenMenuItemShortcut menuItemShortcut = new NuGenMenuItemShortcut(menuItem); TreeNode node = nodes.Add(menuItemShortcut.GetText()); node.Tag = menuItemShortcut; if (menuItem.MenuItems != null && menuItem.MenuItems.Count > 0) { AddMenuTreeNodes(node.Nodes, menuItem.MenuItems); } } } }