public void ShutDown() { // Unregister all plugins registered by this module. We could unregister // them individually if we had more than one, but this is the most convenient // for most plugins to do on shutdown. PluginManager.UnregisterAll(this); // This is for a clean removal, we don't want the editor referencing // a destroyed component. PluginManager.Core.LoadProject -= on_LoadProject; PluginManager.Core.UnloadProject -= on_UnloadProject; // And we can optionally null things out just to be safe: _list.Dispose(); _list = null; }
public void Initialize(ISettings conf) { // Create a new instance of your custom widget, like so: _list = new TaskListPane { Dock = DockStyle.Fill }; // Register the task list as a plugin. Since TaskList implements // IDockPane, this also automatically adds an entry for it to the View menu. PluginManager.Register(this, _list, "Task List"); // You can add special event listeners, if you want. A task list must // be able to, well, load a task list, so in this case we can use these // to our advantage. PluginManager.Core.LoadProject += on_LoadProject; PluginManager.Core.UnloadProject += on_UnloadProject; // Here we make sure the list is loaded when the plugin has been activated. if (PluginManager.Core.Project != null) { _list.LoadList(PluginManager.Core.Project.RootPath); } }