示例#1
0
 /// <summary>
 /// method of starting all processes
 /// </summary>
 public void Comparisone()
 {
     try
     {
         if (!Directory.Exists(this.import.Root))
         {
             Console.WriteLine("Error open directory");
             return;
         }
         ComparisonFile.TestFile(this.import, this.export);
         ComparisonFile.DeleteFile(this.export.Files);
         OperatinDirectory.TestDirectory(this.import, this.export);
     }
     catch (Exception e)
     {
         Console.ForegroundColor = ConsoleColor.Red;
         Console.WriteLine(e.Message);
         Console.ResetColor();
         Console.ReadKey(true);
         this.export.ClearError();
     }
     finally
     {
         this.Reset();
     }
 }
 /// <summary>
 /// method for cleaning a folder in case of an error
 /// </summary>
 public void ClearError()
 {
     ComparisonFile.DeleteFile(this.newFile);
     OperatinDirectory.DeleteDir(this.newDir);
     foreach (var key in this.moveFile.Keys)
     {
         ComparisonFile.MoveFile(key, this.moveFile[key]);
     }
 }