Esempio n. 1
0
        private void RetrieveArticleCore(string command, IArticleHeadersProcessor headers, IArticleBodyProcessor body)
        {
            //body.SetCapacity(5000);

            bool readingHeader = true;

            foreach (string s in DoArticleCommand(command, Rfc977ResponseCodes.ArticleRetrieved))
            {
                if (readingHeader)
                {
                    if (s.Length == 0)
                    {
                        readingHeader = false;
                    }
                    else
                    {
                        headers.AddHeader(s);
                    }
                }
                else
                {
                    body.AddText(s);
                }
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Retrieves the article for the specified message id.
 /// </summary>
 /// <param name="messageId">The message id.</param>
 /// <param name="header">The header.</param>
 /// <param name="body">The body.</param>
 public virtual void RetrieveArticle(string messageId, IArticleHeadersProcessor header, IArticleBodyProcessor body)
 {
     ValidateMessageIdArgument(messageId);
     RetrieveArticleCore("ARTICLE " + messageId, header, body);
 }
Esempio n. 3
0
 /// <summary>
 /// Retrieves the article for the specified article id.
 /// </summary>
 /// <param name="articleId">The article id.</param>
 /// <param name="header">The header.</param>
 /// <param name="body">The body.</param>
 public virtual void RetrieveArticle(int articleId, IArticleHeadersProcessor header, IArticleBodyProcessor body)
 {
     RetrieveArticleCore("ARTICLE " + articleId, header, body);
 }
 private void RetrieveArticleCore(string command, IArticleHeadersProcessor headers, IArticleBodyProcessor body)
 {
     bool readingHeader = true;
     foreach (string s in DoArticleCommand(command, Rfc977ResponseCodes.ArticleRetrieved))
     {
         if (readingHeader)
         {
             if (s.Length == 0)
             {
                 readingHeader = false;
             }
             else
             {
                 headers.AddHeader(s);
             }
         }
         else
         {
             body.AddText(s);
         }
     }
 }
 /// <summary>
 /// Retrieves the article for the specified message id.
 /// </summary>
 /// <param name="messageId">The message id.</param>
 /// <param name="header">The header.</param>
 /// <param name="body">The body.</param>
 public virtual void RetrieveArticle(string messageId, IArticleHeadersProcessor header, IArticleBodyProcessor body)
 {
     ValidateMessageIdArgument(messageId);
     RetrieveArticleCore("ARTICLE " + messageId, header, body);
 }
 /// <summary>
 /// Retrieves the article for the specified article id.
 /// </summary>
 /// <param name="articleId">The article id.</param>
 /// <param name="header">The header.</param>
 /// <param name="body">The body.</param>
 public virtual void RetrieveArticle(int articleId, IArticleHeadersProcessor header, IArticleBodyProcessor body)
 {
     RetrieveArticleCore("ARTICLE " + articleId, header, body);
 }