public void FindFolders() { string[] dirs = Directory.GetDirectories(_Path); foreach (string dir in dirs) { MFolder fol = new MFolder(); fol.Path = dir; fol.Name = System.IO.Path.GetFileName(dir); fol.FindFolders(); _Folders.Add(fol); } }
void AddRootFolder() { FolderBrowserDialog fo = new FolderBrowserDialog(); fo.Description = "Add roms folder"; fo.ShowNewFolderButton = true; if (fo.ShowDialog(this) == DialogResult.OK) { MFolder folderr = new MFolder(); folderr.Path = fo.SelectedPath; folderr.Name = Path.GetFileName(fo.SelectedPath); folderr.FindFolders(); BASE.FOLDERS.Add(folderr); RefreshFolders(); ShouldSaveFolders = true; } }
void AddFolder() { if (treeView1.SelectedNode == null) { return; } FolderBrowserDialog fo = new FolderBrowserDialog(); fo.Description = "Add roms folder"; fo.ShowNewFolderButton = true; if (fo.ShowDialog(this) == DialogResult.OK) { MFolder folderr = new MFolder(); folderr.Path = fo.SelectedPath; folderr.Name = Path.GetFileName(fo.SelectedPath); folderr.FindFolders(); ((TreeNode_Folder)treeView1.SelectedNode).Folder.Folders.Add(folderr); ((TreeNode_Folder)treeView1.SelectedNode).FindFolders(); treeView1.SelectedNode.Expand(); ShouldSaveFolders = true; } }