Пример #1
0
 public void AddTask(string searchLine, KnownConverter converter, string searchDir)
 {
     if (!string.IsNullOrEmpty(searchDir) && !SearchTasks.Any(i => i.SearchLine.Equals(searchLine) && i.Converter.Equals(converter) && i.SearchDir.Equals(searchDir)))
     {
         var task = new SearchTask
         {
             SearchDir  = searchLine,
             SearchLine = searchDir,
             Converter  = converter
         };
         SearchTasks.Add(task);
     }
 }
Пример #2
0
 public void AddTask(SearchTask task)
 {
     if (task.Converter == KnownConverter.None)
     {
         var ftasks = SearchTasks.Where(i => i.SearchLine.Equals(task.SearchLine)).ToArray();
         foreach (var item in ftasks)
         {
             SearchTasks.Remove(item);
         }
     }
     else
     {
         if (!string.IsNullOrEmpty(task.SearchDir) && !SearchTasks.Any(i => i.SearchLine.Equals(task.SearchLine) && i.Converter.Equals(task.Converter) && i.SearchDir.Equals(task.SearchDir)))
         {
             SearchTasks.Add(task);
         }
     }
 }