Пример #1
0
        private static IList <FileRecord> GetRecords(string src, string journal)
        {
            Console.WriteLine("Scanning files...");
            var records = FileRecordTools.GetFileRecords(src).ToList();

            Console.WriteLine("Processing result...");
            records = FindConflicts(FindDuplicates(records).ToList()).ToList();
            Console.WriteLine("Process copy or not...");
            records = CopyOrNot(records).ToList();

            Console.WriteLine("Exporting to excel...");
            ExportExcel(records, journal);

            Console.WriteLine("Generate stats for source directory");
            GenerateBasicStats(records);
            return(records);
        }
Пример #2
0
        static void CopyFilesFromSrcToDst(string src, string dst, string journalFilename, bool simulate)
        {
            var journal = Path.Combine(dst, journalFilename);

            Console.WriteLine("Removing old journal file..");
            if (File.Exists(journal))
            {
                File.Delete(journal);
            }

            var records = GetRecords(src, journal);

            if (simulate == false)
            {
                Console.WriteLine("Copying files");
                CopyFiles(records, dst);

                Console.WriteLine("Generate stats for destination directory");
                var recordsDst = FileRecordTools.GetFileRecords(dst).ToList();
                GenerateBasicStats(recordsDst);
            }
            System.Diagnostics.Process.Start("explorer", journal);
        }