Ejemplo n.º 1
0
 bool IsDone(string filePath, out MyFile file, Log log = null)
 {
     filePath = Path.GetFullPath(filePath);
     file     = null;
     if (File.Exists(filePath))
     {
         file = new MyFile(filePath);
         foreach (var f in filesDone)
         {
             if (f.FullName == file.FullName && f.CreateDate == file.CreateDate)
             {
                 return(true);
             }
         }
         return(false);
     }
     if (log != null)
     {
         log.Add($"Файл не найден: {filePath}");
     }
     return(true);
 }
Ejemplo n.º 2
0
 public void CheckDoneFiles(string fileNamesPath)
 {
     if (File.Exists(fileNamesPath))
     {
         foreach (var line in File.ReadAllLines(fileNamesPath))
         {
             try
             {
                 MyFile file = MyFile.GetFromJson(line);
                 if ((DateTime.Today - file.CreateDate).TotalDays > 10)
                 {
                     continue;
                 }
                 filesDone.Add(file);
             }
             catch (Exception ex)
             {
                 Console.WriteLine();
                 Console.WriteLine($"Error!!! {ex.Message}");
                 Console.WriteLine();
             }
         }
     }
 }
Ejemplo n.º 3
0
 public void Add(MyFile myFile)
 {
     Add(filesDone, myFile.GetJson());
 }