private void LoadMenuStrip(IEnumerable <IPlugin> allPlugins, MenuStripManager m) { MenuItemManager m2 = new MenuItemManager(); foreach (var plugin in allPlugins) { foreach (var menuItem in plugin.MenuItems) { AddMenuItem(m2, menuItem); } } m.Merge(m2); }
public Form1(FTPReleaseSideFactory leftSide, LocalTempSideFactory rightSide) { if (leftSide == null) { throw new ArgumentNullException(nameof(leftSide)); } if (rightSide == null) { throw new ArgumentNullException(nameof(rightSide)); } InitializeComponent(); this.menuStripManager = new MenuStripManager(this.menuStrip1); this.leftSide = leftSide; this.rightSide = rightSide; IEnumerable <IPlugin> plugins = ObtainPlugins(); LoadMenuStrip(plugins, this.menuStripManager); }