public PluginManager(Dictionary <string, MethodInfo> plugins) { InitializeComponent(); Plugins = plugins; foreach (var plugin in plugins) { ListOfPlugins.Items.Add(plugin.Key); } _pluginsLoader = ContainerForUnity.MainContainer.Resolve <IPluginsLoader>(); _changesInfo = new ChangesInfo(); }
private void BindPluginsMenuItem(ChangesInfo changes) { foreach (var plugin in changes.Removed) { pluginsMenuItem.DropDownItems.RemoveByKey(plugin); } foreach (var plugin in changes.Added) { pluginsMenuItem.DropDownItems.Add(new ToolStripMenuItem(plugin) { Name = plugin }); pluginsMenuItem.DropDownItems[plugin].Click += (s, e) => { _notepadPresenter.ExecutePluginWork(plugin); }; } }