private SynchronizedFile CreateSynchronizedFile(ref int filenumber, string file) { string filePath = file.Replace(_startDirectory, ""); string fileName = GetFileName(filenumber, filePath); DateTime modified = File.GetLastWriteTime(file); filenumber++; SynchronizedFile record = new SynchronizedFile(file, filePath, fileName, _packageName + "\\" + fileName, modified); return(record); }
private void MapFiles() { //Needed to create directories before adding files to them modifiedFiles.Sort(); int filenumber = 0; foreach (var file in modifiedFiles) { SynchronizedFile record = CreateSynchronizedFile(ref filenumber, file); filesMap.synchronizedFiles.Add(record); } foreach (var directory in createdDirectories) { SynchronizedFile record = CreateSynchronizedFile(ref filenumber, directory); filesMap.synchronizedDirectories.Add(record); } }