示例#1
0
 /// <summary>
 /// Retrieves the newsgroups.
 /// </summary>
 /// <returns></returns>
 public virtual IEnumerable <NewsgroupHeader> RetrieveNewsgroups()
 {
     foreach (string s in DoBasicCommand("LIST", Rfc977ResponseCodes.NewsgroupsFollow))
     {
         yield return(NewsgroupHeader.Parse(s));
     }
 }
 /// <summary>
 /// Retrieves the newsgroups.
 /// </summary>
 /// <param name="wildcardMatch">The wildcard match.</param>
 /// <returns></returns>
 public virtual IEnumerable <NewsgroupHeader> RetrieveNewsgroups(string wildcardMatch)
 {
     if (m_supportsListActive)
     {
         foreach (string s in DoBasicCommand("LIST ACTIVE " + wildcardMatch, Rfc977ResponseCodes.NewsgroupsFollow))
         {
             yield return(NewsgroupHeader.Parse(s));
         }
     }
     else
     {
         throw new NotImplementedException();
     }
 }
 /// <summary>
 /// Retrieves the newsgroups.
 /// </summary>
 /// <returns></returns>
 public override IEnumerable <NewsgroupHeader> RetrieveNewsgroups()
 {
     if (m_supportsListActive)
     {
         foreach (string s in DoBasicCommand("LIST ACTIVE", Rfc977ResponseCodes.NewsgroupsFollow))
         {
             yield return(NewsgroupHeader.Parse(s));
         }
     }
     else
     {
         // I can't use the base class to do this.
         foreach (string s in DoBasicCommand("LIST", Rfc977ResponseCodes.NewsgroupsFollow))
         {
             yield return(NewsgroupHeader.Parse(s));
         }
     }
 }
示例#4
0
        /// <summary>
        /// Retrieves the new newsgroups.
        /// </summary>
        /// <param name="dateTime">The value time.</param>
        /// <param name="timeZone">The time zone.</param>
        /// <param name="distributions">The distributions.</param>
        /// <returns></returns>
        public virtual IEnumerable <NewsgroupHeader> RetrieveNewNewsgroups(DateTime dateTime, TimeZoneOption timeZone, string distributions)
        {
            string command = string.Format("NEWGROUPS {0:yyMMdd} {0:HHmmss}", dateTime);

            if (timeZone == TimeZoneOption.UseGreenwichMeanTime)
            {
                command += " GMT";
            }

            if (!string.IsNullOrEmpty(distributions))
            {
                command += " ";
                command += distributions;
            }

            foreach (string s in DoBasicCommand(command, Rfc977ResponseCodes.NewNewsgroupsFollow))
            {
                yield return(NewsgroupHeader.Parse(s));
            }
        }