/// <summary> /// Adds all the "user"/"group" objects to the tree /// </summary> /// <param name="container"></param> /// <param name="parentPage"></param> /// <param name="plugin"></param> /// <param name="PageType"></param> public AddUsertoGroup(IPlugInContainer container, MPPage parentPage, ADUCPlugin plugin, int PageType) : this() { this.IPlugInContainer = container; _addplugin = plugin; _aducRootnode = _addplugin.GetPlugInNode(); _PageType = PageType; if (_aducRootnode.Nodes.Count > 0) { ADUCDirectoryNode rootNode = ADUCDirectoryNode.GetDirectoryRoot(_addplugin.GetpluginContext(), _addplugin.GetRootDN(), Resources.ADUC, typeof (ADUCPage), _addplugin); if (rootNode != null) { treeView1.Nodes.Add(rootNode); rootNode.Refresh(); treeView1.ExpandAll(); } } else { Logger.Log("The LWTreeView control does not have any nodes."); } }
public ContextMenu GetTreeContextMenu(LACTreeNode nodeClicked) { Logger.Log("FileShareManagerPlugIn.GetTreeContextMenu", Logger.FileShareManagerLogLevel); if (nodeClicked == null) { return(null); } else { ContextMenu fileShareManagerContextMenu = null; StandardPage fileShareManagerPage = (StandardPage)nodeClicked.PluginPage; if (fileShareManagerPage == null) { Type type = nodeClicked.NodeType; object o = Activator.CreateInstance(type); if (o is IPlugInPage) { ((IPlugInPage)o).SetPlugInInfo(_container, nodeClicked.Plugin, nodeClicked, (LWTreeView)nodeClicked.TreeView, nodeClicked.sc); } } if (_pluginNode == nodeClicked) { fileShareManagerContextMenu = new ContextMenu(); MenuItem m_item = new MenuItem("Set Target Machine", new EventHandler(cm_OnConnect)); fileShareManagerContextMenu.MenuItems.Add(0, m_item); } else if (nodeClicked.Name.Trim().Equals(Resources.FileShares)) { SharesPage sharesPage = fileShareManagerPage as SharesPage; if (sharesPage != null) { fileShareManagerContextMenu = sharesPage.GetTreeContextMenu(); } } else if (nodeClicked.Name.Trim().Equals(Resources.OpenSessions)) { SessionPage sessionPage = fileShareManagerPage as SessionPage; if (sessionPage != null) { fileShareManagerContextMenu = sessionPage.GetTreeContextMenu(); } } else if (nodeClicked.Name.Trim().Equals(Resources.OpenFiles)) { FilesPage filesPage = fileShareManagerPage as FilesPage; if (filesPage != null) { fileShareManagerContextMenu = filesPage.GetTreeContextMenu(); } } return(fileShareManagerContextMenu); } }
private void lvChildNodes_MouseDoubleClick(object sender, MouseEventArgs e) { ListView lvSender = sender as ListView; if (lvSender != null) { ListViewHitTestInfo hti = lvSender.HitTest(e.X, e.Y); if (hti != null && hti.Item != null) { ListViewItem lvItem = hti.Item; if (!lvItem.Selected) { lvItem.Selected = true; } if (lvItem.Tag != null) { LACTreeNode pluginnode = lvItem.Tag as LACTreeNode; ContextMenu contextmenu = null; if (pluginnode != null) { lmctreeview.SelectedNode = pluginnode; lmctreeview.Select(); if (e.Button == MouseButtons.Right) { IPlugIn plugin = pluginnode.Plugin; contextmenu = plugin.GetTreeContextMenu(pluginnode); } else if (e.Button == MouseButtons.Left) { if (pluginnode.Nodes.Count != 0) { pluginnode.sc.manage.ShowControl(pluginnode); } else { IPlugIn plugin = pluginnode.Plugin; contextmenu = plugin.GetTreeContextMenu(pluginnode); } } } if (contextmenu != null) { contextmenu.Show(lvSender, new Point(e.X, e.Y)); } else { Logger.Log( "ConsolePage::lvChildNodes_MouseDoubleClick, menu == null", Logger.manageLogLevel); } } } } }
public override void SetPlugInInfo(IPlugInContainer container, IPlugIn pi, LACTreeNode treeNode, LWTreeView lmctreeview, CServerControl sc) { plugin = pi as ServiceManagerPlugin; base.SetPlugInInfo(container, pi, treeNode, lmctreeview, sc); bEnableActionMenu = false; ShowHeaderPane(true); Refresh(); }
public void SetData(LACTreeNode node) { string strCorp = node.Plugin.GetName(); this.Text = string.Format("About {0}", strCorp); this.pictureBox.Image = node.image; this.lblCorporation.Text = string.Format(this.lblCorporation.Text, strCorp); this.lblAboutPlugin.Text = node.Plugin.GetDescription() ; }
public void SetData(LACTreeNode node) { string strCorp = node.Plugin.GetName(); this.Text = string.Format("About {0}", strCorp); this.pictureBox.Image = node.image; this.lblCorporation.Text = string.Format(this.lblCorporation.Text, strCorp); this.lblAboutPlugin.Text = node.Plugin.GetDescription(); }
public void EnumChildren(LACTreeNode parentNode) { Logger.Log("EventlogPlugin.EnumChildren", Logger.eventLogLogLevel); if (_pluginNode != null && parentNode == _pluginNode && Hostinfo.HasCreds(_hn)) { EventViewerControl eventlogPage = (EventViewerControl)_pluginNode.PluginPage; eventlogPage.LoadData(EventViewerControl.EventViewerNodeType.PLUGIN); } return; }
public override void SetPlugInInfo(IPlugInContainer container, IPlugIn pi, LACTreeNode treeNode, LWTreeView lmctreeview, CServerControl sc) { Hostinfo hn = ctx as Hostinfo; base.SetPlugInInfo(container, pi, treeNode, lmctreeview, sc); bEnableActionMenu = false; plugin = pi as FileShareManagerIPlugIn; hn = plugin.HostInfo; Refresh(); }
private void BuildLogNodes() { if (_pluginNode != null) { if (eventLogHandle != null) { _pluginNode.Text = "Event Viewer for " + _hn.hostName + ""; } else { _pluginNode.Text = Properties.Resources.sTitleEventsPage; } _pluginNode.Nodes.Clear(); //UInt32 eventCount = EventlogAdapter.GetCategoryCount(eventLogHandle); UInt32 eventCount = 4; if (eventCount != 0) { //logs = EventlogAdapter.GetDistinctCategories(eventLogHandle, eventCount); logs = new string[] { "Application", "Security", "System", "WebBrowser" }; if (logs != null) { foreach (string log in logs) { //this bitmap never gets used for display, but is required by the LACTreeNode constructor. Bitmap bmp = new Bitmap(Resources.EventViewer_48.ToBitmap(), 32, 32); LACTreeNode logNode = new LACTreeNode(log.ToString(), bmp, typeof(LogNodePage), this); logNode.Tag = ef; logNode.ImageIndex = (int)Manage.ManageImageType.EventLog; logNode.SelectedImageIndex = (int)Manage.ManageImageType.EventLog; logNode.sc = _pluginNode.sc; _pluginNode.Nodes.Add(logNode); } } } _pluginNode.ExpandAll(); _currentHost = _hn.hostName; EventViewerControl eventlogPage = _pluginNode.PluginPage as EventViewerControl; if (eventlogPage != null) { eventlogPage.LoadData(EventViewerControl.EventViewerNodeType.PLUGIN); } } }
public AddRemovePluginDlg(Manage controlManage, LACTreeNode rootNode, LWTreeView lmcTreeview) { InitializeComponent(); Text = "Add/Remove Plug-in..."; _controlManage = controlManage; _rootNode = rootNode; _lmcTreeview = lmcTreeview; ((EditDialog)this).ShowApplyButton = false; InitializePages(); }
private void treeView1_AfterExpand(object sender, TreeViewEventArgs e) { LACTreeNode node = (LACTreeNode)e.Node; if (sender != null && node != null) { if (node.ImageIndex == (int)Manage.ManageImageType.Container) { node.ImageIndex = (int)Manage.ManageImageType.ContainerOpen; node.SelectedImageIndex = (int)Manage.ManageImageType.ContainerOpen; } } }
public void DeserializePluginInfo(XmlNode node, ref LACTreeNode pluginNode, string nodepath) { try { Manage.DeserializeHostInfo(node, ref pluginNode, nodepath, ref _hn, false); pluginNode.Text = this.GetName(); pluginNode.Name = this.GetName(); } catch (Exception ex) { Logger.LogException("EventlogPlugin.DeserializePluginInfo()", ex); } }
private void visitOneNode(LACTreeNode node, int level) { if (!node.IsPluginNode) { return; } string str = node.Text; if (node.Text.Contains("(")) { str = node.Text.Substring(0, node.Text.IndexOf('(')); } Logger.Log( "Node: " + node.Text + " Level: " + level, Logger.manageLogLevel); AddedPluginInfo pluginInfo = null; //Tried to avoid referring the tree node from the Console Root. LACTreeNode pluginnode = node.DeepCopy() as LACTreeNode; if (level > 0) { char[] spacing = new char[level * 2]; for (int i = 0; i < level * 2; i++) { spacing[i] = ' '; } pluginInfo = new AddedPluginInfo(string.Concat(new string(spacing), str), level, nodeindex, pluginnode); this.PluginComboBox.Items.Add(pluginInfo); } else { pluginInfo = new AddedPluginInfo(str, level, nodeindex, pluginnode); this.PluginComboBox.Items.Add(pluginInfo); } nodeindex++; node.Tag = pluginnode.Tag = this.PluginComboBox.Items.Count - 1; foreach (LACTreeNode n in node.Nodes) { if (n.IsPluginNode) { pluginnode.Nodes.Add(n.DeepCopy()); visitOneNode(n, level + 1); } } }
/// <summary> /// only list those children that are group type /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) { // When a Node is selected, ShowNode already gets called because of LWTreeView1_NodeMouseClick LACTreeNode node = e.Node as LACTreeNode; if (node is ADUCDirectoryNode) { ADUCDirectoryNode dirnode = node as ADUCDirectoryNode; dirnode.ListChildren(); groupInfo.groupName = dirnode.DistinguishedName; groupInfo.objectName = dirnode.DistinguishedName; } }
private LACTreeNode GetRootNode() { if (_rootNode == null) { //this bitmap never gets used for display, but is required by the LACTreeNode constructor. Bitmap bmp = new Bitmap(32, 32); _rootNode = new LACTreeNode("Console", bmp, typeof(ConsolePage), this); _rootNode.IsPluginNode = true; } return(_rootNode); }
public override void SetPlugInInfo( IPlugInContainer container, IPlugIn pi, LACTreeNode treeNode, LWTreeView lmctreeview, CServerControl sc ) { base.SetPlugInInfo(container, pi, treeNode, lmctreeview, sc); bEnableActionMenu = false; plugin = pi as FileBrowserIPlugIn; Refresh(); }
public void DeserializePluginInfo(XmlNode node, ref LACTreeNode pluginNode, string nodepath) { try { Hostinfo _hn = GetContext() as Hostinfo; Manage.DeserializeHostInfo(node, ref pluginNode, nodepath, ref _hn, false); pluginNode.Text = this.GetName(); pluginNode.Name = this.GetName(); } catch (Exception ex) { Logger.LogException("ServiceManagerPlugin.DeserializePluginInfo()", ex); } }
private void pluginListview_selectedindexChanged(object sender, EventArgs e) { if (PluginlistView.SelectedItems.Count == 0) { return; } LACTreeNode node = PluginlistView.SelectedItems[0].Tag as LACTreeNode; if (node != null) { lblDescription.Text = node.Plugin.GetDescription(); } }
private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) { LACTreeNode node = (LACTreeNode)e.Node; int lastIndex = navigationHistory.Count - 1; if (sender != null && node != null) { Logger.Log(String.Format( "treeView1_AfterSelect({0})", node.Name), Logger.manageLogLevel); } }
private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { LACTreeNode node = (LACTreeNode)e.Node; if (sender != null && node != null) { if (e.Button == System.Windows.Forms.MouseButtons.Right) { Logger.Log("treeView1_NodeMouseClick: Right Click", Logger.manageLogLevel); // first, see if the page implements a context menu ContextMenu cm = null; if (node.PluginPage != null) { cm = node.PluginPage.GetPlugInContextMenu(); } if (cm == null && node.Plugin != null) { cm = node.Plugin.GetTreeContextMenu(node); } if (cm != null && node.TreeView != null) { cm.Show(node.TreeView, new Point(e.X, e.Y)); } } else { if (node.TreeView.SelectedNode != node) { node.TreeView.SelectedNode = node; node.TreeView.Select(); ShowNode(node); if (node != null && node.TreeView != null) { node.TreeView.SelectedNode = node; node.TreeView.Select(); } } Logger.Log( "treeView1_NodeMouseClick: Left Click", Logger.manageLogLevel); } } }
private void BuildNodesToPlugin() { if (_pluginNode != null) { Icon ic = Resources.SharedFolder2; LACTreeNode shNode = Manage.CreateIconNode(Resources.FileShares, ic, typeof(FileSharesPage), this); _pluginNode.Nodes.Add(shNode); LACTreeNode osNode = Manage.CreateIconNode(Resources.OpenSessions, ic, typeof(SessionPage), this); _pluginNode.Nodes.Add(osNode); LACTreeNode ofNode = Manage.CreateIconNode(Resources.sOpenFiles, ic, typeof(FilesPage), this); _pluginNode.Nodes.Add(ofNode); } }
/// <summary> /// Sets the Plugin information to base /// List the all child nodes, then refreshes the listview with the all child treenodes. /// </summary> /// <param name="ccontainer"></param> /// <param name="pi"></param> /// <param name="treeNode"></param> /// <param name="lmctreeview"></param> public override void SetPlugInInfo(IPlugInContainer ccontainer, IPlugIn pi, LACTreeNode treeNode, LWTreeView lmctreeview, CServerControl sc) { if (treeNode.sc != null) { smallimagelist = treeNode.sc.manage.manageImageList as ImageList; Lagreimagelist = treeNode.sc.manage.manageLargeImageList as ImageList; } base.SetPlugInInfo(ccontainer, pi, treeNode, lmctreeview, sc); if (treeNode != null) { Refresh(); } }
private LACTreeNode GetFileShareManagerNode() { Logger.Log("FileShareManagerPlugIn.GetFileShareManagerNode", Logger.FileShareManagerLogLevel); if (_pluginNode == null) { Icon ic = Resources.SharedFolder2; _pluginNode = Manage.CreateIconNode("File Browser", ic, typeof(FilesBrowserPluginPage), this); _pluginNode.ImageIndex = (int)Manage.ManageImageType.Generic; _pluginNode.SelectedImageIndex = (int)Manage.ManageImageType.Generic; _pluginNode.IsPluginNode = true; } return(_pluginNode); }
private LACTreeNode GetServiceManagerNode() { Logger.Log("ServiceManagerPlugin.GetServiceManagerNode", Logger.ServiceManagerLoglevel); if (_pluginNode == null) { Icon ic = Properties.Resources.agent_lgr; _pluginNode = Manage.CreateIconNode(Properties.Resources.ServiceManager, ic, typeof(ServiceManagerEditorPage), this); _pluginNode.ImageIndex = (int)Manage.ManageImageType.Generic; _pluginNode.SelectedImageIndex = (int)Manage.ManageImageType.Generic; _pluginNode.IsPluginNode = true; } return(_pluginNode); }
private bool IsPlugInAlreadyAdded(LACTreeNode lacNode) { bool bIsFound = false; if (PluginslistView != null && PluginslistView.Items.Count != 0) { foreach (ListViewItem lvItem in PluginslistView.Items) { if (lvItem.Text.Trim().Equals(lacNode.Text.Trim())) { bIsFound = true; } } } return(bIsFound); }
public ContextMenu GetTreeContextMenu(LACTreeNode nodeClicked) { Logger.Log("ServiceManagerPlugin.GetTreeContextMenu", Logger.ServiceManagerLoglevel); if (nodeClicked == null) { return(null); } ContextMenu contextMenu = null; MenuItem m_item; if (nodeClicked.PluginPage == null) { Type type = nodeClicked.NodeType; object o = Activator.CreateInstance(type); if (o is IPlugInPage) { ((IPlugInPage)o).SetPlugInInfo(_container, nodeClicked.Plugin, nodeClicked, (LWTreeView)nodeClicked.TreeView, nodeClicked.sc); } } ServiceManagerEditorPage editorPage = nodeClicked.PluginPage as ServiceManagerEditorPage; contextMenu = new ContextMenu(); m_item = new MenuItem("&Export List...", new EventHandler(editorPage.On_MenuClick)); m_item.Enabled = false; m_item.Tag = _pluginNode; contextMenu.MenuItems.Add(m_item); m_item = new MenuItem("-"); contextMenu.MenuItems.Add(m_item); m_item = new MenuItem("&Refresh", new EventHandler(editorPage.On_MenuClick)); m_item.Tag = _pluginNode; contextMenu.MenuItems.Add(m_item); m_item = new MenuItem("-"); contextMenu.MenuItems.Add(m_item); m_item = new MenuItem("&Help", new EventHandler(editorPage.On_MenuClick)); contextMenu.MenuItems.Add(contextMenu.MenuItems.Count, m_item); return(contextMenu); }
private void insertNode(LACTreeNode rootnode) { int index = (int)rootnode.Tag; if (index == _pluginStandalonePage.pluginCombobox_selectedIndex) { //find the correct node to insert the added plug-ins if (_addedplugins.Count > 0) { foreach (LACTreeNode lacnode in _addedplugins) { Type t = lacnode.Plugin.GetType(); Assembly pluginDll = Assembly.GetAssembly(t); LACTreeNodeList nodesInAssembly = _controlManage.LoadPlugInsFromAssembly(pluginDll); foreach (LACTreeNode node in nodesInAssembly) { if (node.t.Namespace.Equals("Likewise.LMC.Plugins.GPOEPlugin", StringComparison.InvariantCultureIgnoreCase)) { node.Text = lacnode.Text; node.Tag = lacnode.Tag; } node.SetContext(lacnode.Plugin.GetContext()); node.Plugin.SetContext(lacnode.Plugin.GetContext()); //node.Plugin.SetContext(rootnode.Plugin.GetContext()); rootnode.Nodes.Add(node); rootnode.Plugin.AddExtPlugin(node.Plugin); if (_removedplugings.Contains(lacnode)) { _removedplugings.Remove(lacnode); _removedplugings.Add(node); } } } } return; } foreach (LACTreeNode n in rootnode.Nodes) { if (n.IsPluginNode) { insertNode(n); } } }
private LACTreeNode GetLUGNode() { if (_pluginNode == null) { Logger.Log( "LUGPlugIn.GetLUGNode: _pluginNode == null", Logger.manageLogLevel); _pluginNode = new LACTreeNode("Local Users and Groups", Resources.LocalGroup_16, typeof(DummyLUGPage), this); uNode = new LACTreeNode("Users", Resources.LocalGroup_16, typeof(LocalUserPage), this); uNode.sc = _pluginNode.sc; _pluginNode.Nodes.Add(uNode); gNode = new LACTreeNode("Groups", Resources.LocalGroup_16, typeof(LocalGroupPage), this); gNode.sc = _pluginNode.sc; _pluginNode.Nodes.Add(gNode); } foreach (TreeNode node in _pluginNode.Nodes) { LACTreeNode lacNode = (LACTreeNode)node; if (lacNode != null) { lacNode.SetContext(_hn); if (lacNode.NodeType == typeof(LocalUserPage)) { lacNode.ImageIndex = (int)Manage.ManageImageType.User; lacNode.SelectedImageIndex = (int)Manage.ManageImageType.User; } else if (lacNode.NodeType == typeof(LocalGroupPage)) { lacNode.ImageIndex = (int)Manage.ManageImageType.Group; lacNode.SelectedImageIndex = (int)Manage.ManageImageType.Group; } } } _pluginNode.ImageIndex = (int)Manage.ManageImageType.Group; _pluginNode.SelectedImageIndex = (int)Manage.ManageImageType.Group; _pluginNode.IsPluginNode = true; return(_pluginNode); }
private void lvFilePage_DoubleClick( object sender, EventArgs e) { FileBrowserNode parent = base.TreeNode as FileBrowserNode; int count = lvFilePage.SelectedItems.Count; if (parent == null) { return; } if (count != 1) { return; } TreeNode[] nodes = base.TreeNode.Nodes.Find(lvFilePage.SelectedItems[0].Text, true); if (nodes == null || nodes.Length == 0) { return; } LACTreeNode node = nodes[0] as LACTreeNode; plugin.EnumChildren(node); if (node != null) { if (node.TreeView != null) { parent.TreeView.SelectedNode = node; treeNode = node; if (node.Nodes.Count > 0) { node.Expand(); } Refresh(); } } }
/// <summary> /// Gets the selected "user" or "group" info from the tree /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { if (sender != null) { bool IsValidObject = false; if (e.Button != System.Windows.Forms.MouseButtons.Right) { LACTreeNode node = e.Node as LACTreeNode; ADUCDirectoryNode dirnode = node as ADUCDirectoryNode; if (dirnode != null) { if (_PageType == MEMOF_PAGE) { dirnode.ListGroupOUChildren(); if (dirnode.ObjectClass.Trim().ToLower().Equals("group")) { IsValidObject = true; } groupInfo.groupName = dirnode.DistinguishedName; } if (_PageType == MEMBERS_PAGE) { dirnode.ListGroupAndUserOUChildren(); if (dirnode.ObjectClass.Trim().ToLower().Equals("group") || dirnode.ObjectClass.Trim().ToLower().Equals("user")) { IsValidObject = true; } groupInfo.objectName = dirnode.DistinguishedName; } } if (!IsValidObject) { Okbtn.Enabled = false; } else { Okbtn.Enabled = true; } } } }
private void ChosenPluginlistView_SelectedIndexChanged(object sender, EventArgs e) { if (ChosenPluginlistView.SelectedItems.Count == 0) { Removebtn.Enabled = false; Aboutbtn.Enabled = false; return; } Removebtn.Enabled = true; Aboutbtn.Enabled = true; LACTreeNode node = ChosenPluginlistView.SelectedItems[0].Tag as LACTreeNode; if (node != null) { lblDescription.Text = node.Plugin.GetDescription(); } }
private void btnBrowse_Click(object sender, EventArgs e) { LACTreeNode PluginNode = plugin.GetPlugInNode(); LACTreeNode rootDNnode = PluginNode.Tag as LACTreeNode; dirContext = rootDNnode.Tag as DirectoryContext; ObjectsListPage objectsPage = new ObjectsListPage(); objectsPage.SetData(dirContext, plugin, container); if (objectsPage.ShowDialog(this) == DialogResult.OK) { lblGPO.Text = objectsPage.GPODisplayName; Wizard.enableButton(WizardDialog.WizardButton.Finish); objectSelectDlg.displayName = objectsPage.GPODisplayName; objectSelectDlg.distinguishedName = objectsPage.DistinguishedName; } }
/// <summary> /// Override constructor gets the Plugin node and all its childs /// Adds the all nodes to the treeview /// </summary> /// <param name="container"></param> /// <param name="parentPage"></param> /// <param name="plugin"></param> /// <param name="origTreeview"></param> public ADMoveObjectPage(IPlugInContainer container, StandardPage parentPage, ADUCPlugin plugin, LWTreeView origTreeview) : this() { this.IPlugInContainer = container; _addplugin = plugin; _origLWTreeView = origTreeview; _aducRootnode = _addplugin.GetPlugInNode(); if (_aducRootnode.Nodes.Count > 0) { /*TreeNode[] newTreeArray = new TreeNode[_aducRootnode.Nodes.Count]; // Iterate through the root nodes in the Nodes property. _aducRootnode.Nodes.CopyTo(newTreeArray, 0); foreach (TreeNode node in newTreeArray) { LACTreeNode lacnode = node as LACTreeNode; // treeView1.Nodes.Add(lacnode.DeepCopy() as TreeNode); }*/ ADUCDirectoryNode rootNode = ADUCDirectoryNode.GetDirectoryRoot(_addplugin.GetpluginContext(), _addplugin.GetRootDN(), Resources.ADUC, typeof (ADUCPage), _addplugin); if (rootNode != null) { treeView1.Nodes.Add(rootNode); ADUCDirectoryNode[] childNodes = rootNode.ListContainerChildren(rootNode); if (childNodes != null) rootNode.Nodes.AddRange(childNodes); treeView1.ExpandAll(); } } else { Logger.Log("The LWTreeView control does not have any nodes."); } }
/// <summary> /// Method that creates and initializes the ADUC Rootnode /// </summary> /// <returns></returns> private LACTreeNode GetADUCRootNode() { Logger.Log("ADUCPlugin.GetADUCRootNode", Logger.manageLogLevel); if (_pluginNode == null) { _hn = new Hostinfo(); _pluginNode = Manage.CreateIconNode(Resources.ADUCTitle, Resources.ADUC, typeof(ADUCPage), this); _pluginNode.IsPluginNode = true; } _pluginNode.ImageIndex = (int)Manage.ManageImageType.Generic; _pluginNode.SelectedImageIndex = (int)Manage.ManageImageType.Generic; return _pluginNode; }
public ContextMenu GetTreeContextMenu(LACTreeNode nodeClicked) { Logger.Log("FileShareManagerPlugIn.GetTreeContextMenu", Logger.FileShareManagerLogLevel); if (nodeClicked == null) { return null; } else { ContextMenu fileShareManagerContextMenu = null; StandardPage fileShareManagerPage = (StandardPage)nodeClicked.PluginPage; if (fileShareManagerPage == null) { Type type = nodeClicked.NodeType; object o = Activator.CreateInstance(type); if (o is IPlugInPage) { ((IPlugInPage)o).SetPlugInInfo(_container, nodeClicked.Plugin, nodeClicked, (LWTreeView)nodeClicked.TreeView, nodeClicked.sc); } } if (_pluginNode == nodeClicked) { fileShareManagerContextMenu = new ContextMenu(); MenuItem m_item = new MenuItem("Set Target Machine", new EventHandler(cm_OnConnect)); fileShareManagerContextMenu.MenuItems.Add(0, m_item); } else if (nodeClicked.Name.Trim().Equals(Resources.FileShares)) { SharesPage sharesPage = fileShareManagerPage as SharesPage; if (sharesPage != null) { fileShareManagerContextMenu = sharesPage.GetTreeContextMenu(); } } else if (nodeClicked.Name.Trim().Equals(Resources.OpenSessions)) { SessionPage sessionPage = fileShareManagerPage as SessionPage; if (sessionPage != null) { fileShareManagerContextMenu = sessionPage.GetTreeContextMenu(); } } else if (nodeClicked.Name.Trim().Equals(Resources.OpenFiles)) { FilesPage filesPage = fileShareManagerPage as FilesPage; if (filesPage != null) { fileShareManagerContextMenu = filesPage.GetTreeContextMenu(); } } return fileShareManagerContextMenu; } }
public void EnumChildren(LACTreeNode parentNode) { Logger.Log("FileShareManagerPlugIn.EnumChildren", Logger.FileShareManagerLogLevel); return; }
public void SerializePluginInfo(LACTreeNode pluginNode, ref int Id, out XmlElement viewElement, XmlElement ViewsNode, TreeNode SelectedNode) { viewElement = null; }
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 BuildLogNodes() { if (_pluginNode != null) { if (eventLogHandle != null) _pluginNode.Text = "Event Viewer for " + _hn.hostName + ""; else _pluginNode.Text = Properties.Resources.sTitleEventsPage; _pluginNode.Nodes.Clear(); //UInt32 eventCount = EventlogAdapter.GetCategoryCount(eventLogHandle); UInt32 eventCount = 4; if (eventCount != 0) { //logs = EventlogAdapter.GetDistinctCategories(eventLogHandle, eventCount); logs = new string[]{ "Application", "Security", "System", "WebBrowser" }; if (logs != null) { foreach (string log in logs) { //this bitmap never gets used for display, but is required by the LACTreeNode constructor. Bitmap bmp = new Bitmap(Resources.EventViewer_48.ToBitmap(), 32, 32); LACTreeNode logNode = new LACTreeNode(log.ToString(), bmp, typeof(LogNodePage), this); logNode.Tag = ef; logNode.ImageIndex = (int)Manage.ManageImageType.EventLog; logNode.SelectedImageIndex = (int)Manage.ManageImageType.EventLog; logNode.sc = _pluginNode.sc; _pluginNode.Nodes.Add(logNode); } } } _pluginNode.ExpandAll(); _currentHost = _hn.hostName; EventViewerControl eventlogPage = _pluginNode.PluginPage as EventViewerControl; if (eventlogPage != null) eventlogPage.LoadData(EventViewerControl.EventViewerNodeType.PLUGIN); } }
private LACTreeNode GetIndexNode(LACTreeNode node, int idx) { if (!node.IsPluginNode) return node; if (idx == (int)node.Tag) return node; foreach (LACTreeNode n in node.Nodes) { if (!n.IsPluginNode) continue; if (idx == (int)n.Tag) return n; } foreach (LACTreeNode n in node.Nodes) { if (n.IsPluginNode) { LACTreeNode lnode = GetIndexNode(n, idx); if (lnode != null) return lnode; } } return node; }
private void visitOneNode(LACTreeNode node, int level) { if (!node.IsPluginNode) return; string str = node.Text; if (node.Text.Contains("(")) str = node.Text.Substring(0, node.Text.IndexOf('(')); Logger.Log( "Node: " + node.Text + " Level: " + level, Logger.manageLogLevel); AddedPluginInfo pluginInfo = null; //Tried to avoid referring the tree node from the Console Root. LACTreeNode pluginnode = node.DeepCopy() as LACTreeNode; if (level > 0) { char[] spacing = new char[level * 2]; for (int i = 0; i < level * 2; i++) spacing[i] = ' '; pluginInfo = new AddedPluginInfo(string.Concat(new string(spacing), str), level, nodeindex, pluginnode); this.PluginComboBox.Items.Add(pluginInfo); } else { pluginInfo = new AddedPluginInfo(str, level, nodeindex, pluginnode); this.PluginComboBox.Items.Add(pluginInfo); } nodeindex++; node.Tag = pluginnode.Tag = this.PluginComboBox.Items.Count - 1; foreach (LACTreeNode n in node.Nodes) { if (n.IsPluginNode) { pluginnode.Nodes.Add(n.DeepCopy()); visitOneNode(n, level + 1); } } }
/// <summary> /// List the all children for the selected distinguished name /// Adds the all children to the node /// </summary> public void ListOUChildren(string distinguishedName) { Items = new List<LACTreeNode>(); Logger.Log("ObjectsListPage.ListOUChildren() called", Logger.ldapLogLevel); int ret = -1; List<LdapEntry> ldapEntries = null; ret = dirContext.ListChildEntriesSynchronous (distinguishedName, LdapAPI.LDAPSCOPE.ONE_LEVEL, "(objectClass=organizationalUnit)", new string[] { "dummy", "objectClass", "distinguishedName", "userAccountControl", null }, false, out ldapEntries); if (ldapEntries == null || ldapEntries.Count == 0) { if (ret == (int)Likewise.LMC.Utilities.ErrorCodes.LDAPEnum.LDAP_SERVER_DOWN || ret == (int)Likewise.LMC.Utilities.ErrorCodes.LDAPEnum.LDAP_CONNECT_ERROR || ret == -1) { if (ret == -1) { ret = (int)ErrorCodes.LDAPEnum.LDAP_TIMEOUT; Logger.LogMsgBox(ErrorCodes.LDAPString(ret)); } } } foreach (LdapEntry ldapNextEntry in ldapEntries) { string currentDN = ldapNextEntry.GetDN(); if (!String.IsNullOrEmpty(currentDN)) { LACTreeNode newNode = new LACTreeNode(currentDN, Properties.Resources.addserver.ToBitmap(), null, plugin); newNode.Tag = currentDN; Logger.Log(String.Format("new Entry: {0}", currentDN), Logger.ldapLogLevel); Items.Add(newNode); } } DirectoryEntry rootDE = new DirectoryEntry(distinguishedName); if (rootDE != null) { string gpLinkEntries = null; if (rootDE.Properties["gpLink"].Value != null) gpLinkEntries = rootDE.Properties["gpLink"].Value.ToString(); if (gpLinkEntries != null) { string[] gplinkTokens = gpLinkEntries.Split(']'); foreach (string gpLink in gplinkTokens) { if (gpLink.Trim().Length == 0) continue; string gpoLink = gpLink.Substring(1, gpLink.IndexOf(';') - 1); DirectoryEntry de = new DirectoryEntry(gpoLink); if (de != null && de.Parent != null && de.Properties != null) { if (de.Properties["distinguishedName"].Value != null) { string sDN = string.Empty; string name = string.Empty; sDN = de.Properties["distinguishedName"].Value.ToString(); if (de.Properties["displayName"].Value != null) name = de.Properties["displayName"].Value.ToString(); LACTreeNode newNode = new LACTreeNode(name, Properties.Resources.addserver.ToBitmap(), null, plugin); newNode.Tag = sDN; Items.Add(newNode); } } } } } }
public ContextMenu GetTreeContextMenu(LACTreeNode nodeClicked) { FileBrowserNode node = nodeClicked as FileBrowserNode; ContextMenu fileBrowserContextMenu = null; MenuItem menuItem = null; StandardPage fileBrowserPage = (StandardPage)nodeClicked.PluginPage; _selectedNode = _pluginNode.TreeView.SelectedNode as LACTreeNode; _currentNode = nodeClicked; if (fileBrowserPage == null) { Type type = nodeClicked.NodeType; object o = Activator.CreateInstance(type); if (o is IPlugInPage) { ((IPlugInPage)o).SetPlugInInfo(_container, nodeClicked.Plugin, nodeClicked, (LWTreeView)nodeClicked.TreeView, nodeClicked.sc); } } if (node == null) { return fileBrowserContextMenu; } if (node.FBNodeType == FileBrowserNode.FileBrowserNopeType.ROOT) { fileBrowserContextMenu = new ContextMenu(); menuItem = new MenuItem("View Details", cm_OnSetView_Detail); if (_currentView == View.Details) menuItem.Checked = true; fileBrowserContextMenu.MenuItems.Add(menuItem); menuItem = new MenuItem("View Large Icons", cm_OnSetView_LargeIcon); if (_currentView == View.LargeIcon) menuItem.Checked = true; fileBrowserContextMenu.MenuItems.Add(menuItem); menuItem = new MenuItem("View Small Icons", cm_OnSetView_SmallIcon); if (_currentView == View.SmallIcon) menuItem.Checked = true; fileBrowserContextMenu.MenuItems.Add(menuItem); menuItem = new MenuItem("View List", cm_OnSetView_List); if (_currentView == View.List) menuItem.Checked = true; fileBrowserContextMenu.MenuItems.Add(menuItem); return fileBrowserContextMenu; } fileBrowserContextMenu = new ContextMenu(); menuItem = new MenuItem("Expand", cm_OnExpand); fileBrowserContextMenu.MenuItems.Add(0, menuItem); if (node.Name.Equals(Resources.String_Network)) { menuItem = new MenuItem("Connect share", new EventHandler(cm_OnConnectToShare)); fileBrowserContextMenu.MenuItems.Add(menuItem); } else if (node.Parent.Name.Equals(Resources.String_Network)) { menuItem = new MenuItem("Disconnect share", new EventHandler(cm_OnDisconnectShare)); fileBrowserContextMenu.MenuItems.Add(menuItem); } if (node.FBNodeType == FileBrowserNode.FileBrowserNopeType.SHARE || node.FBNodeType == FileBrowserNode.FileBrowserNopeType.DIRECTORY) { menuItem = new MenuItem("Refresh", cm_OnRefresh); fileBrowserContextMenu.MenuItems.Add(menuItem); menuItem = new MenuItem("New folder", new EventHandler(cm_OnCreateFolder)); fileBrowserContextMenu.MenuItems.Add(menuItem); menuItem = new MenuItem("Copy", new EventHandler(cm_OnCopy)); fileBrowserContextMenu.MenuItems.Add(menuItem); } if (node.FBNodeType == FileBrowserNode.FileBrowserNopeType.DIRECTORY) { menuItem = new MenuItem("Move", new EventHandler(cm_OnMove)); fileBrowserContextMenu.MenuItems.Add(menuItem); menuItem = new MenuItem("Delete", new EventHandler(cm_OnDelete)); fileBrowserContextMenu.MenuItems.Add(menuItem); menuItem = new MenuItem("Rename", new EventHandler(cm_OnRename)); fileBrowserContextMenu.MenuItems.Add(menuItem); } return fileBrowserContextMenu; }
public void EnumChildren(LACTreeNode parentNode) { List<NETRESOURCE> NetResources = new List<NETRESOURCE>(); FileBrowserNode node = parentNode as FileBrowserNode; if (node == null) { return; } if (node.FBNodeType == FileBrowserNode.FileBrowserNopeType.ROOT) { // Enumerate the child nodes of "File Browser" tree root BuildNodesToPlugin(); return; } if (node.Name.Equals("Network")) { // Enumerate the child nodes of the "Network" tree node if (platform == LikewiseTargetPlatform.Windows) { NetResources = GetNetworkConnections(); AddShareNodes(parentNode, NetResources); } else { AddShareNodes(parentNode, RemoteShares); } return; } if (node.Name.Equals("Computer")) { return; } if (node.FBNodeType == FileBrowserNode.FileBrowserNopeType.SHARE || node.FBNodeType == FileBrowserNode.FileBrowserNopeType.DIRECTORY) { // Enum files and directories under share/directory path. List<FileItem> FileList = FileClient.FileClient.EnumFiles(node.Path, false); if (FileList == null || FileList.Count == 0) { return; } foreach (FileItem File in FileList) { if (File.IsDirectory) { AddDirFolderNodes(node, File.FileName); } } } }
private void AddShareNodes( LACTreeNode parentNode, List<string> Shares ) { foreach (string Share in Shares) { TreeNode[] found = parentNode.Nodes.Find(Share, false); if (found == null || found.Length == 0) { FileBrowserNode node = new FileBrowserNode(Share, Resources.Share, typeof(FilesDetailPage), this); node.FBNodeType = FileBrowserNode.FileBrowserNopeType.SHARE; node.Path = Share; parentNode.Nodes.Add(node); } } }
private void AddShareNodes( LACTreeNode parentNode, List<NETRESOURCE> NetResources ) { foreach (NETRESOURCE NetResource in NetResources) { TreeNode[] found = parentNode.Nodes.Find(NetResource.pRemoteName, false); if (found == null || found.Length == 0) { FileBrowserNode node = new FileBrowserNode(NetResource.pRemoteName, Resources.Share, typeof(FilesDetailPage), this); node.FBNodeType = FileBrowserNode.FileBrowserNopeType.SHARE; node.Path = NetResource.pRemoteName; parentNode.Nodes.Add(node); } } }
public void DeserializePluginInfo(XmlNode node, ref LACTreeNode pluginNode, string nodepath) { }
/// <summary> /// List the all children for the selected distinguished name /// Adds the all children to the node /// </summary> public void ListGPOChildren(string distinguishedName) { Items = new List<LACTreeNode>(); Logger.Log("ObjectsListPage.ListGPOChildren() called", Logger.ldapLogLevel); int ret = -1; List<LdapEntry> ldapEntries = null; ret = dirContext.ListChildEntriesSynchronous (distinguishedName, LdapAPI.LDAPSCOPE.ONE_LEVEL, "(objectClass=groupPolicyContainer)", new string[] { null }, false, out ldapEntries); if (ldapEntries == null || ldapEntries.Count == 0) { if (ret == (int)Likewise.LMC.Utilities.ErrorCodes.LDAPEnum.LDAP_SERVER_DOWN || ret == (int)Likewise.LMC.Utilities.ErrorCodes.LDAPEnum.LDAP_CONNECT_ERROR || ret == -1) { if (ret == -1) { ret = (int)ErrorCodes.LDAPEnum.LDAP_TIMEOUT; Logger.LogMsgBox(ErrorCodes.LDAPString(ret)); } } } foreach (LdapEntry ldapNextEntry in ldapEntries) { string currentDN = ldapNextEntry.GetDN(); if (!String.IsNullOrEmpty(currentDN)) { LdapValue[] values = ldapNextEntry.GetAttributeValues("distinguishedName", dirContext); string sDN = ""; if (values != null && values.Length > 0) { sDN = values[values.Length - 1].stringData; } values = ldapNextEntry.GetAttributeValues("displayName", dirContext); string name = ""; if (values != null && values.Length > 0) { name = values[values.Length - 1].stringData; } if (sDN != null && sDN != "" && name != null && name != "") { LACTreeNode newNode = new LACTreeNode(name, Properties.Resources.addserver.ToBitmap(), null, plugin); newNode.Tag = sDN; Items.Add(newNode); Logger.Log(String.Format("new Entry: {0}", currentDN), Logger.ldapLogLevel); } } } }
/// <summary> /// Is a delegate that will be called when we click on any node from the treeview /// And Initializes the contextmenu /// </summary> /// <param name="nodeClicked"></param> /// <returns></returns> public ContextMenu GetTreeContextMenu(LACTreeNode nodeClicked) { Logger.Log("ADUCPlugin.GetTreeContextMenu", Logger.manageLogLevel); if (nodeClicked == null) { return null; } else { ADUCPage aducPage = (ADUCPage) nodeClicked.PluginPage; if (aducPage == null) { Type type = nodeClicked.NodeType; object o = Activator.CreateInstance(type); if (o is IPlugInPage) { ((IPlugInPage)o).SetPlugInInfo(_container, nodeClicked.Plugin, nodeClicked, (LWTreeView) nodeClicked.TreeView, nodeClicked.sc); aducPage = (ADUCPage)nodeClicked.PluginPage; } } ContextMenu aducContextMenu = null; if (aducPage != null) { if (nodeClicked is ADUCDirectoryNode) { aducContextMenu = aducPage.GetTreeContextMenu_curr(nodeClicked as ADUCDirectoryNode); } else { aducContextMenu = aducPage.GetTreeContextMenu(); } } if (_pluginNode == nodeClicked) { if (aducContextMenu == null) { aducContextMenu = new ContextMenu(); } MenuItem m_item = new MenuItem("Connect to Domain", new EventHandler(cm_OnConnect)); aducContextMenu.MenuItems.Add(0, m_item); aducContextMenu.MenuItems.Add(new MenuItem("-")); m_item = new MenuItem("Refresh", new EventHandler(cm_OnMenuClick)); m_item.Tag = nodeClicked; aducContextMenu.MenuItems.Add(m_item); aducContextMenu.MenuItems.Add(new MenuItem("-")); m_item = new MenuItem("Help", new EventHandler(aducPage.cm_OnMenuClick)); aducContextMenu.MenuItems.Add(m_item); } ADUCDirectoryNode dirnode = nodeClicked as ADUCDirectoryNode; return aducContextMenu; } }
public LACTreeNode GetPlugInNode() { Logger.Log("EventlogPlugin.GetPluginNode", Logger.eventLogLogLevel); if (_pluginNode == null) { Logger.Log("EventlogPlugin.GetPluginNode: running Manage.CreateIconNode(EventViewerControl)", Logger.eventLogLogLevel); _pluginNode = Manage.CreateIconNode(Properties.Resources.sTitleEventsPage, Properties.Resources.EventViewer_48, typeof(PluginNodePage), this); _pluginNode.ImageIndex = (int)Manage.ManageImageType.EventLog; _pluginNode.SelectedImageIndex = (int)Manage.ManageImageType.EventLog; _pluginNode.IsPluginNode = true; } return _pluginNode; }
/// <summary> /// If HostInfo is not null,lists the all child nodes on click of any node in left hand pane of ADUC /// </summary> /// <param name="parentNode"></param> public void EnumChildren(LACTreeNode parentNode) { Logger.Log("ADUCPlugin.EnumChildren", Logger.manageLogLevel); if (!Hostinfo.HasCreds(_hn)) { //attempt to retrieve host info information from kerberos Hostinfo defaultHostInfo = new Hostinfo(); //assume for now that the AD hostname is the same as the LDAP domain defaultHostInfo.creds.MachineName = defaultHostInfo.domainName; defaultHostInfo.hostName = defaultHostInfo.domainName; Logger.Log(defaultHostInfo.domainName, Logger.manageLogLevel); //LDAP is not yet kerberized, so set password to null to make sure the user gets prompted defaultHostInfo.creds.Password = null; } }
public ContextMenu GetTreeContextMenu(LACTreeNode nodeClicked) { Logger.Log("EventlogPlugin.GetTreeContextMenu", Logger.eventLogLogLevel); if (nodeClicked == null) { return null; } else { eventlogPage = (EventViewerControl)nodeClicked.PluginPage; if (eventlogPage == null) { Type type = nodeClicked.NodeType; object o = Activator.CreateInstance(type); if (o is IPlugInPage) { ((IPlugInPage)o).SetPlugInInfo(_container, nodeClicked.Plugin, nodeClicked, (LWTreeView) nodeClicked.TreeView, nodeClicked.sc); eventlogPage = (EventViewerControl)nodeClicked.PluginPage; } } ContextMenu eventlogContextMenu = null; if (eventlogPage != null) { eventlogContextMenu = eventlogPage.GetTreeContextMenu(); } if (_pluginNode == nodeClicked) { eventlogContextMenu = new ContextMenu(); MenuItem m_item = new MenuItem("Set Target Machine", new EventHandler(cm_OnConnect)); eventlogContextMenu.MenuItems.Add(0, m_item); m_item = new MenuItem("-"); eventlogContextMenu.MenuItems.Add(1, m_item); m_item = new MenuItem("&View"); MenuItem subm_item = new MenuItem("&Add/Remove Columns...", new EventHandler(cm_OnMenuClick)); m_item.MenuItems.Add(subm_item); subm_item = new MenuItem("-"); m_item.MenuItems.Add(subm_item); subm_item = new MenuItem("C&ustomize View...", new EventHandler(cm_OnMenuClick)); m_item.MenuItems.Add(subm_item); eventlogContextMenu.MenuItems.Add(2, m_item); m_item = new MenuItem("-"); eventlogContextMenu.MenuItems.Add(3,m_item); m_item = new MenuItem("&Help", new EventHandler(cm_OnMenuClick)); eventlogContextMenu.MenuItems.Add(eventlogContextMenu.MenuItems.Count, m_item); } return eventlogContextMenu; } }
private LACTreeNode GetFileShareManagerNode() { Logger.Log("FileShareManagerPlugIn.GetFileShareManagerNode", Logger.FileShareManagerLogLevel); if (_pluginNode == null) { Icon ic = Resources.SharedFolder2; _pluginNode = Manage.CreateIconNode("File Browser", ic, typeof(FilesBrowserPluginPage), this); _pluginNode.ImageIndex = (int)Manage.ManageImageType.Generic; _pluginNode.SelectedImageIndex = (int)Manage.ManageImageType.Generic; _pluginNode.IsPluginNode = true; } return _pluginNode; }
public void SerializePluginInfo(LACTreeNode pluginNode, ref int Id, out XmlElement viewElement, XmlElement ViewsNode, TreeNode SelectedNode) { viewElement = null; try { if (pluginNode == null || !pluginNode._IsPlugIn) return; XmlElement HostInfoElement = null; Manage.InitSerializePluginInfo(pluginNode, this, ref Id, out viewElement, ViewsNode, SelectedNode); Manage.CreateAppendHostInfoElement(_hn, ref viewElement, out HostInfoElement); if (pluginNode != null && pluginNode.Nodes.Count != 0) { foreach (LACTreeNode lacnode in pluginNode.Nodes) { XmlElement innerelement = null; pluginNode.Plugin.SerializePluginInfo(lacnode, ref Id, out innerelement, viewElement, SelectedNode); if (innerelement != null) { viewElement.AppendChild(innerelement); } } } } catch (Exception ex) { Logger.LogException("EventlogPlugin.SerializePluginInfo()", ex); } }
public PluginStandalonePage(AddRemovePluginDlg parentDlg, Manage controlManage, LACTreeNode rootNode, LWTreeView lmcTreeview) { this.pageID = "PluginStandalonePage"; InitializeComponent(); SetPageTitle("Standalone"); _parentDlg = parentDlg; _controlManage = controlManage; _rootNode = rootNode; _lmcTreeview = lmcTreeview; TreeNode node = lmcTreeview.Nodes[0]; ImageList il = new ImageList(); this.ChosenPluginlistView.Items.Clear(); foreach (TreeNode n in node.Nodes) { ListViewItem lviArr; string str = n.Text; if (str.Contains("(")) str = n.Text.Substring(0, n.Text.IndexOf('(')); string[] values = { str }; lviArr = new ListViewItem(values); lviArr.Tag = n; lviArr.ImageIndex = n.ImageIndex;// (int)PluginStandalonePage.GetNodeType(n.Name); this.ChosenPluginlistView.Items.Add(lviArr); } visitOneNode(node as LACTreeNode, 0); if (this.PluginComboBox.Items.Count != 0) { this.PluginComboBox.SelectedIndex = 0; } }