/// <summary> /// Event: Occurs when a directory is found while searching for the given wildcard. /// The directory is polled to be searched if necessary. /// </summary> /// <param name="o"></param> /// <param name="e"></param> private void DirectoryFound(object o, HashEventArgs e) { lock (Poll) { //System.Console.WriteLine("{0}, was found and appended to queue", e.Task); if (!CompletedDirs.Contains(e.Task.ToLower()) && !Poll.Contains(e.Task.ToLower()) && !Exclude(e.Task)) { ManualResetEvent mre = new ManualResetEvent(false); tmpEvents.Add(mre); Task task = new Task((TaskItem)o, wildcards, SearchBrain.List.MaxPerFolder, mre); task.IsSubDir = true; Poll.Add(task); } } }