public MenuStruct(MenuStripField field, string name, string id, List <MenuStruct> dropDownItems) : this() { this.field = field; this.name = name; this.id = id; this.dropDownItems = dropDownItems; }
private void addMenuItem(MenuStripField field, Expandable exa, ToolStripMenuItem item) { ToolStripMenuItem menu; switch (field) { case MenuStripField.File: menu = fileToolStripMenuItem; menu.DropDownItems.Insert(0, item); break; case MenuStripField.View: menu = viewToolStripMenuItem; menu.DropDownItems.Insert(0, item); break; case MenuStripField.Tool: menu = toolToolStripMenuItem; menu.DropDownItems.Insert(0, item); break; case MenuStripField.Option: menu = optionToolStripMenuItem; menu.DropDownItems.Insert(0, item); break; case MenuStripField.Self: IEnumerable <ToolStripMenuItem> menuItems = modulesToolStripMenuItem.DropDownItems.Cast <ToolStripMenuItem>(); menu = menuItems.First(_ => ((Expandable)_.Tag).dllFileName == exa.dllFileName); menu.DropDownItems.Insert(0, item); break; case MenuStripField.Others: default: menu = othersToolStripMenuItem; menu.DropDownItems.Insert(0, item); break; } menu.Visible = true; }
public MenuStruct(MenuStripField field, string name, string id, EventHandler action, List <MenuStruct> dropDownItems) : this(field, name, id, action) { this.dropDownItems = dropDownItems; }
public MenuStruct(MenuStripField field, string name, string id, EventHandler action) : this(field, name, id) { this.action = action; }
public MenuStruct(MenuStripField field, string name, string id) : this() { this.field = field; this.name = name; this.id = id; }