Example #1
0
        public void WriteHeader(MimeHeaderReader reader)
        {
            this.AssertOpen();
            Header header = Header.ReadFrom(reader);

            header.WriteTo(this);
        }
Example #2
0
 public static Header ReadFrom(MimeHeaderReader reader)
 {
     if (reader.MimeReader == null)
     {
         throw new ArgumentNullException("reader");
     }
     return(reader.MimeReader.ReadHeaderObject());
 }
Example #3
0
        public void WritePart(MimeReader reader)
        {
            if (reader == null)
            {
                throw new ArgumentNullException("reader");
            }
            this.AssertOpen();
            if (!MimeReader.StateIsOneOf(reader.ReaderState, MimeReaderState.PartStart | MimeReaderState.InlineStart))
            {
                throw new InvalidOperationException(Strings.OperationNotValidInThisReaderState);
            }
            this.StartPart();
            MimeHeaderReader headerReader = reader.HeaderReader;

            while (headerReader.ReadNextHeader())
            {
                this.WriteHeader(headerReader);
            }
            this.WriteContent(reader);
            this.EndPart();
        }