Example #1
0
        // 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.
            });
        }
Example #2
0
 // Startup's a module.
 private void StartupModule(Module module)
 {
     module.Startup();
 }
Example #3
0
 /// <summary>
 /// Kills the wrapped module
 /// </summary>
 public void Kill()
 {
     this._instance.Dispose();
     this._instance = null;
 }