public A(BInterface B) { b = B; }
private void EvaluateRSSList() { AllRSSURLs.AddRange(Program.RSSList.ToArray()); CallBackUpdateErrorLog("Found " + AllRSSURLs.Count.ToString() + " RSS URLs.\r\n"); CallBackUpdateLabelFields(); RetrieveRSSviaXML RSS_Feeder = new RetrieveRSSviaXML(); foreach (string url in AllRSSURLs) { CallBackUpdateErrorLog("Extracting articles from " + url); try { List <NewsItem> tempList = RSS_Feeder.readRSSforXML(url); AllNewsItems.AddRange(tempList.GetRange(0, (tempList.Count > 9)?10:tempList.Count).ToArray()); CallBackUpdateErrorLog(tempList.Count.ToString() + " articles extracted."); } catch (Exception ex) { string errorCode = "Extraction failed. " + ex.Message; CallBackUpdateErrorLog(errorCode); } } CallBackUpdateErrorLog("\r\nExtracted total of " + AllNewsItems.Count.ToString() + " news articles.\r\n"); CallBackUpdateLabelFields(); CallBackUpdateErrorLog("Loading Bayesian Probabilty Statistics from Survey Data..."); BInterface BI_Algo = new BInterface(); double temp_Double = 0; foreach (NewsItem item in AllNewsItems) { try { temp_Double = BI_Algo.TestString(item.description); } catch (Exception) { continue; } if (temp_Double <= evalutaionCriteria) { passedItems.Add(item); } else { failedItems.Add(item); } CallBackUpdateLabelFields(); } CallBackUpdateErrorLog("Evaluation Done."); foreach (NewsItem item in passedItems) { List <string> tempCheckList = new List <string>(); tempCheckList.AddRange(StaticLists.toBeDownloadList.ToArray()); tempCheckList.AddRange(StaticLists.doneDownloadList.ToArray()); string _url = item.URL.Trim(); if (!tempCheckList.Contains(_url)) { StaticLists.toBeDownloadList.Add(_url); } } }