/// <summary> /// Mode 3: Process One directory, Process 2nd Dir. with recursive sub-directory support. Calls SetFileDateTime() /// (Only adds to the confirm list, Form 2 will actually write changes). /// </summary> /// <param name="targetPath">Full path to the targetPath directory</param> /// <param name="comparePath">Full path to the comparePath directory</param> /// req, checkBox_Recurse.Checked, checkBoxShouldFiles.Checked internal void RecurseSubDirectoryMode3(string targetPath, string comparePath) { //no point continuing if we have nothing matching to compare to. if (!Directory.Exists(comparePath)) { return; } if (!comparePath.EndsWith(SharedHelper.SeperatorString)) { comparePath += SharedHelper.Seperator; } // Take a snapshot of the paths of the file system. Makes an IEnumerable. IEnumerable <string> destFileList = GetFilesAndDirsSafely(targetPath, "*", true); IEnumerable <string> srcFileList = GetFilesAndDirsSafely(comparePath, "*", true); // Find the common files. It produces a sequence and doesn't execute until the foreach statement. IEnumerable <string> queryCommonFiles = srcFileList.Intersect(destFileList, SharedHelper.explorerStringEqualityComparer(targetPath, comparePath)); foreach (string f in queryCommonFiles) { NameDateQuick srcfiletime = GetCmaTimesFromFilesystem(f); string nameChanged = f.Replace(comparePath, targetPath); bool isDirectory = Directory.Exists(nameChanged); SkipOrAddFile(nameChanged, isDirectory); var currentobject = new NameDateObjListViewVMdl(srcfiletime) { Name = nameChanged, FileOrDirType = SharedHelper.Bool2Int(isDirectory) }; //If Checkbox is selected: writes each time time to the date attribute that was radiobutton selected. StoreDateByCMACheckboxes(currentobject); var item = new NameDateObj(currentobject.Converter()); FilestoConfirmList.Add(item); } }