private void btnLoadSrcDir_Click(object sender, EventArgs e) { if (String.IsNullOrEmpty(tbSourceDir.Text) || !Directory.Exists(tbSourceDir.Text)) { MessageBox.Show("Enter valid path into Source Directory Box", "Invalid Path", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } _srcFolder = new FolderItem(new DirectoryInfo(tbSourceDir.Text)); _FillDirectoryTree(tvwSource, _srcFolder, FolderItem.FolderDepth); }
private void _FillDirectoryTree(TreeView tvw, FolderItem folderItem, int nodeDepth) { tvw.Nodes.Clear(); tvw.Nodes.Add(_GetTreeNodes(folderItem.GetDirInfo, nodeDepth)); }
public void TestFolderItemCreate() { var folderItem = new FolderItem(new DirectoryInfo(@"c:\temp")); Assert.IsTrue(folderItem.GetDirInfo.Exists); }