Пример #1
0
 public bool IsMatch(FileClass file)
 {
     if (file == null)
     {
         throw new Exception("Matching: файл " + Id + " : null\n");
     }
     if (file.Id != "" && this.Id != "" && file.Id != this.Id)
     {
         return(false);
     }
     if (FileNamePattern != "" && !Regex.IsMatch(file.ShortName, FileNamePattern))
     {
         MatchResult = "имя файла " + file.ShortName + " не удовлетворяет шаблону";
         return(false);
     }
     if (file.Size < MinFileSize || file.Size > MaxFileSize)
     {
         MatchResult = "размер файла " + file.ShortName + " лежит вне диапазона [" + MinFileSize + "," + MaxFileSize + "]";
         return(false);
     }
     return(true);
 }
Пример #2
0
 public void Add(FileClass file)
 {
     Files.Add(file);
 }