public void PollCity(object sender, DoWorkEventArgs e) { stopWatch.Start(); List<EntryInfo> entries = new List<EntryInfo>(); SearchSection(areaDetails.Website, "", ref entries); numEntriesToSearch += entries.Count; OnNumberOfEntriesFound(numEntriesToSearch); if (numEntriesToSearch == 0) return; for (int i = 0; i < entries.Count; i++) { EntryInfo entry = entries[i]; AdFilter filter = new AdFilter(); filter.ParseURLAsync(ref entry, clwParseURLCompletedHandler); } waitHandle.WaitOne(); }
public void PollCity(object sender, DoWorkEventArgs e) { stopWatch.Start(); List<List<EntryInfo>> EntryInfoSectionList = new List<List<EntryInfo>>(); Int32 numEntriesToSearch = 0; foreach (Dictionary<string, SubsectionDetails> subSections in details.Sections.Values) { List<EntryInfo> entries = new List<EntryInfo>(); foreach (SubsectionDetails subSection in subSections.Values) { try { string site = details.CityWebsite + "/" + subSection.Suffix; SearchSection(site, "", ref subSection.TopFiveEntriesFromLastSearch, ref entries); } catch (Exception error) { OnPollError(details.City, error.ToString()); } } numEntriesToSearch += entries.Count; EntryInfoSectionList.Add(entries); } OnNumberOfEntriesFound(numEntriesToSearch); foreach (List<EntryInfo> entryList in EntryInfoSectionList) { for (int i = 0; i < entryList.Count; i++ ) { EntryInfo entry = entryList[i]; AdFilter filter = new AdFilter(); filter.ParseURLAsync(ref entry, clwParseURLCompletedHandler); } } }