void AddItem(SimPe.Interfaces.IHelp topic) { HelpTopicMenuItem htmi = new HelpTopicMenuItem(topic); string[] path = htmi.GetMenuPath(); System.Windows.Forms.ToolStripMenuItem parent = mbi; for (int i = 0; i < path.Length - 1; i++) { string n = SimPe.Localization.GetString(path[i]); System.Windows.Forms.ToolStripMenuItem m = null; foreach (System.Windows.Forms.ToolStripMenuItem item in parent.DropDownItems) { if (item.Text.Trim().ToLower() == n.Trim().ToLower()) { m = item; break; } } if (m == null) { m = new System.Windows.Forms.ToolStripMenuItem(n); parent.DropDownItems.Add(m); } parent = m; } parent.DropDownItems.Add(htmi); }
public HelpTopicMenuItem(SimPe.Interfaces.IHelp topic) : base() { this.topic = topic; this.Text = GetName(); this.Image = topic.Icon; this.Click += new EventHandler(HelpTopicMenuItem_Activate); }