Beispiel #1
0
        /// <summary>
        /// Method to perform first task for Variant 2.
        /// Output all unique files between two directories.
        /// </summary>
        private void FindUniqueFiles()
        {
            this.Writer.WriteLine("\nVar 2 Task 1: Unique Files\n");

            try
            {
                var watch = System.Diagnostics.Stopwatch.StartNew();

                DirectorySearcher searcher = new DirectorySearcher();
                var files = searcher.GetUniqueFiles(this.firstDirectory, this.secondDirectory);

                watch.Stop();
                this.Writer.WriteLine($"Time of searching: {watch.ElapsedMilliseconds:N}");

                OutputList(files, "Var 2 Task 2: Unique files.", "var1task2Result");
            }
            catch (ArgumentException e)
            {
                this.Writer.WriteLine(e.Message);
                this.Logger.LogMessage($"Class - SeventhTrainingRunner | Method - FindUniqueFiles | " +
                                       $"{e.Message}");
            }
        }