/// <summary> /// Fills items to the specified tool strip item collection /// </summary> public static void FillMenuItems(ToolStripItemCollection items, XmlNode node) { switch (node.Name) { case "menu": String name = XmlHelper.GetAttribute(node, "name"); if (name == "SyntaxMenu") { node.InnerXml = GetSyntaxMenuXml(); } items.Add(GetMenu(node)); break; case "separator": items.Add(GetSeparator(node)); break; case "button": ToolStripMenuItem menu = GetMenuItem(node); items.Add(menu); // Add menu first to get the id correct String id = GetMenuItemId(menu); if (id.IndexOf('.') > -1 && ShortcutManager.GetRegisteredItem(id) == null) { ShortcutManager.RegisterItem(id, menu); } else { ShortcutManager.RegisterSecondaryItem(menu); } break; } }
/// <summary> /// Fills items to the specified tool strip item collection /// </summary> public static void FillToolItems(ToolStripItemCollection items, XmlNode node) { switch (node.Name) { case "separator": items.Add(GetSeparator(node)); break; case "button": ToolStripItem button = GetButtonItem(node); items.Add(button); // Add button first to get the id correct ShortcutManager.RegisterSecondaryItem(button); break; } }