/// <summary> /// Searches the TreeView for the node containing the specified path. /// Child nodes are created as neccessary. /// </summary> protected MultiSyncTreeNode GetNodeFromPath(TreeNode rootNode, string path) { path = path.Trim('\\'); string[] parts = path.Split('\\'); foreach (MultiSyncTreeNode node in rootNode.Nodes) { if (node.Text == parts[0]) { if (parts.Length > 1) { // If cildren have not been created, create them. if (node.Tag == null) { continue; } if (!(node.Tag is FileEntryInformation)) { continue; } FileEntryInformation info = (node.Tag as FileEntryInformation); if (!info.ChildrenCreated) { CreateGrandChildren(node.Parent as MultiSyncTreeNode); } return(GetNodeFromPath(node, path.Substring(path.IndexOf('\\') + 1))); } return(node); } } return(null); }
public void Add(FileEntryInformation entry) { InnerList.Add(entry); }