public void ReadFromFolder(string folderPath) { foreach (string DirName in Directory.GetDirectories(folderPath)) { ShmotCategory sc = new ShmotCategory(Path.GetFileName(DirName)); CatList.Add(sc); foreach (string FileName in Directory.GetFiles(DirName)) { Shmot sh = new Shmot(FileName, sc); sc.list.Add(sh); } } }
public Shmot(string FilePath, ShmotCategory sc) { PathPhoto = FilePath; Name = Path.GetFileName(FilePath); category = sc; }