// Register's modules main-menu item's. private void AttachModuleMenus(Module p) { Dictionary<string, ToolStripMenuItem> menus = p.GetMenus(); // request the module menus. if (menus == null) return; if (menus.Count <= 0) return; this.AsyncInvokeHandler(() => { var parent = new ToolStripMenuItem(p.Attributes.Name, p.Attributes.Icon); // create the parent module-menu. menuModules.DropDownItems.Add(parent); // add the parent-menu. foreach (KeyValuePair<string, ToolStripMenuItem> pair in menus) parent.DropDownItems.Add(pair.Value); // add requested sub-menu as a drop-down menu. }); }
// Startup's a module. private void StartupModule(Module module) { module.Startup(); }
/// <summary> /// Kills the wrapped module /// </summary> public void Kill() { this._instance.Dispose(); this._instance = null; }