public NNTP_NewsGroups ParseNewsGroups(string wildcard) { NNTP_NewsGroups allGroups = new NNTP_NewsGroups(); GetGroups(allGroups); NNTP_NewsGroups selGroups = new NNTP_NewsGroups(); string[] groupParams = wildcard.Split(Convert.ToChar(",")); foreach(string param in groupParams) { if(param == "*") { return allGroups; } if(param.IndexOf("*") == -1) { if(allGroups.Contains(param)) { selGroups.Add(param,0,0,0,DateTime.Today); } } if(param.IndexOf("*") >= 0) { foreach(NNTP_NewsGroup ng in allGroups.Newsgroups) { if(ng.Name.CompareTo(param) == param.Length -1) { selGroups.Add(param,0,0,0,DateTime.Today); } } } } return selGroups; }
public NNTP_ListGroups_eArgs(NNTP_Session session,NNTP_NewsGroups groups) { m_pSession = session; m_pGroups = groups; }
/// <summary> /// Returns all the newsgroups with article count. /// </summary> public void GetGroups(NNTP_NewsGroups groups) { DataSet ds = new DataSet(); ds.ReadXml(m_DataPath + "NewsGroups.xml"); foreach(DataRow dr in ds.Tables[0].Rows) { groups.Add(dr["Name"].ToString(),GetArticleCount(dr["Name"].ToString()),GetMinArticle(dr["Name"].ToString()),GetMaxArticle((string)dr["Name"]),Convert.ToDateTime(dr["Date"].ToString())); } }