public int AccumulateAllInfo() { int success=0; recInfo = GetFolderInfo(rootFolder, null, ""); string foldername = rootFolder;//.Remove(rootFolder.Length - 1); NoOfFiles = fileHash.Count; recInfo.SetRootFolderName(rootFolder.Substring(foldername.LastIndexOf('\\') + 1, foldername.Length - foldername.LastIndexOf('\\') - 1)); return success; }
FolderInfo GetFolderInfo(string folder, FolderInfo info, string relPath) { relPath += ( folder.Substring(folder.LastIndexOf('\\') + 1, folder.Length - folder.LastIndexOf('\\') - 1) + "\\" ); FolderInfo finfo = GetFilesAndFoldersinFolder(id, folder, relPath); foreach (string subfolder in finfo.FolderInside) { FolderInfo t = GetFolderInfo(subfolder, finfo, relPath); } folderInfo.Add(finfo); folderHash.Add(relPath, id); id++; if (info != null) info.FoldersInfo.Add(finfo); else info = finfo; return info; }
public FolderMetaData(int nfiles, long totalsize, List<FolderInfo> folders, Dictionary<string, int> ftoId, List<FileInfo> files, Dictionary<string, int> filetoid, FolderInfo recinfo) { nSplitFiles = nfiles; tSize = totalsize; foldersInfo = folders; folderToId = ftoId; filesInfo = files; fileToId = filetoid; recFolderInfo = recinfo; }