} //getUnansweredQuestions() /*************************************************************************** * <placeholder for header> * ****************************************************************************/ public List <string> getSiteURLs() { int currentItems = mDomainURL2SiteInfo.Count; List <string> toReturn = new List <string> (currentItems); //No sorting for now... Dictionary <string, siteItem> .Enumerator hashEnumerator2 = mDomainURL2SiteInfo.GetEnumerator(); while (hashEnumerator2.MoveNext()) { string curSiteDomainURL = hashEnumerator2.Current.Key; siteItem curSiteInformation = hashEnumerator2.Current.Value; toReturn.Add(curSiteDomainURL); } //Hash iteration. return(toReturn); } //getSiteURLs()
/**************************************************************************** * * ****************************************************************************/ private void addURL(string aSiteDomainURL, string aSiteName) { //For now: Just add to the normal list with some // acceptable default values. int len = aSiteName.Length; string msg = null; if (len == 0) { msg = "Empty site name for '" + aSiteDomainURL + "...'"; } else { if (aSiteName.Substring(len - 1, 1) == " ") { msg = "The site name, '" + aSiteName + "', contains a trailing space..."; } } if (msg != null) { System.Windows.Forms.MessageBox.Show(msg); System.Diagnostics.Trace.WriteLine(msg); } int currentItems = mDomainURL2SiteInfo.Count; int orderKey = currentItems + 200; if (!mDomainURL2SiteInfo.ContainsKey(aSiteDomainURL)) { addSiteItem(aSiteDomainURL, 100, 200, 10, orderKey, aSiteName); } else { siteItem someItem = mDomainURL2SiteInfo[aSiteDomainURL]; someItem.name = aSiteName; mDomainURL2SiteInfo[aSiteDomainURL] = someItem; //Write back... } } //addURL()
/*************************************************************************** * <placeholder for header> * ****************************************************************************/ public int getUnansweredQuestions() { siteItem currentSiteInfo = getCurrentSiteInfo(); return(currentSiteInfo.unansweredQuestions); } //getUnansweredQuestions()
/*************************************************************************** * <placeholder for header> * ****************************************************************************/ public int getPosts() { siteItem currentSiteInfo = getCurrentSiteInfo(); return(currentSiteInfo.posts); }