private void showNode(LACTreeNode node) { if (!node.IsPluginNode) { return; } //list the content under this node in "ChosenPluginlistView" this.ChosenPluginlistView.Items.Clear(); int index = (int)node.Tag; if (index == this.pluginCombobox_selectedIndex) { foreach (LACTreeNode n in node.Nodes) { if (!n.IsPluginNode) { continue; } string str = n.Text; if (n.Text.Contains("(")) { str = n.Text.Substring(0, n.Text.IndexOf('(')); } string[] values = { str }; ListViewItem lviArr = new ListViewItem(values); lviArr.Tag = GetIndexNode(_rootNode, (int)n.Tag); lviArr.ImageIndex = (int)PluginStandalonePage.GetNodeType(n.Name); this.ChosenPluginlistView.Items.Add(lviArr); } return; } foreach (LACTreeNode n in node.Nodes) { if (n.IsPluginNode) { showNode(n); } } }
private void InitializePages() { MPPage page = null; page = new PluginStandalonePage(this, _controlManage, _rootNode, _lmcTreeview); this.AddPage(page, new MPMenuItem(page.PageID, "Standalone", "Standalone"), MPMenu.POSITION_BEGINING ); this._pluginStandalonePage = page as PluginStandalonePage; /* * page = new PluginExtensionsPage(); * this.AddPage(page, * new MPMenuItem(page.PageID, "Extensions", "Extensions"), * MPMenu.POSITION_END * ); */ }
public AddPluginsDlg(AddRemovePluginDlg grandparentDlg, Manage controlManage, LACTreeNode rootNode, PluginStandalonePage standalonePage, ListView listView) { InitializeComponent(); this.Text = "Add Stand-Alone Plug-In"; _controlManage = controlManage; _rootNode = rootNode; _standalonePage = standalonePage; _grandParent = grandparentDlg; this.PluginslistView = listView; //fill in PluginListview with existing plug-ins Logger.Log("AddPluginsDlg constructor", Logger.manageLogLevel); string[] dllPathList = Directory.GetFiles(Application.StartupPath, "*.dll"); List <ListViewItem> liItems = new List <ListViewItem>(); ImageList il = new ImageList(); foreach (string dllPath in dllPathList) { if (Path.GetFileName(dllPath) == sRootPluginName) { continue; } try { Assembly pluginDll = Assembly.LoadFile(dllPath); LACTreeNodeList nodesInAssembly = _controlManage.LoadPlugInsFromAssembly(pluginDll); foreach (LACTreeNode node in nodesInAssembly) { ListViewItem lvi = new ListViewItem(node.Text); lvi.Tag = node; lvi.ImageIndex = node.ImageIndex; liItems.Add(lvi); } } catch (BadImageFormatException) { // // Ignore DLLs that are not managed code. // } catch (Exception e) { Debugger.Log(9, "Exception", e.ToString()); } } // sort the items liItems.Sort(this); // add to the list view ListViewItem[] lvItems = new ListViewItem[liItems.Count]; liItems.CopyTo(lvItems); PluginlistView.Items.AddRange(lvItems); if (PluginlistView.Items.Count > 0) { PluginlistView.Items[0].Selected = true; } }
private void InitializePages() { MPPage page = null; page = new PluginStandalonePage(this, _controlManage, _rootNode, _lmcTreeview); this.AddPage(page, new MPMenuItem(page.PageID, "Standalone", "Standalone"), MPMenu.POSITION_BEGINING ); this._pluginStandalonePage = page as PluginStandalonePage; /* page = new PluginExtensionsPage(); this.AddPage(page, new MPMenuItem(page.PageID, "Extensions", "Extensions"), MPMenu.POSITION_END ); */ }