public void FindMFolders() { var dirs = Directory.GetDirectories(Path); foreach (var dir in dirs) { var fol = new MFolder(); fol.Path = dir; fol.Name = System.IO.Path.GetFileName(dir); fol.FindMFolders(); MFolders.Add(fol); } }
private void AddFolder() { if (treeView1.SelectedNode == null) return; var fo = new FolderBrowserDialog(); fo.Description = "Add roms folder"; fo.ShowNewFolderButton = true; if (fo.ShowDialog(this) == DialogResult.OK) { var folderr = new MFolder(); folderr.Path = fo.SelectedPath; folderr.Name = Path.GetFileName(fo.SelectedPath); folderr.FindMFolders(); ((TreeNodeFolder) treeView1.SelectedNode).Folder.MFolders.Add(folderr); ((TreeNodeFolder) treeView1.SelectedNode).FindFolders(); treeView1.SelectedNode.Expand(); } }
private void AddRootFolder() { var fo = new FolderBrowserDialog(); fo.Description = "Add roms folder"; fo.ShowNewFolderButton = true; if (fo.ShowDialog(this) == DialogResult.OK) { var folderr = new MFolder(); folderr.Path = fo.SelectedPath; folderr.Name = Path.GetFileName(fo.SelectedPath); folderr.FindMFolders(); Program.Settings.Folders.Add(folderr); RefreshFolders(); } }