Example #1
0
        /// <summary>
        /// Processes mime specific headers.
        /// </summary>
        /// <returns>A mime entity with mime specific headers parsed.</returns>
        private void ProcessHeaders()
        {
            foreach (string key in _entity.Headers.AllKeys)
            {
                switch (key)
                {
                case "content-description":
                    _entity.ContentDescription = _entity.Headers[key];
                    break;

                case "content-disposition":
                    _entity.ContentDisposition = new ContentDisposition(_entity.Headers[key]);
                    break;

                case "content-id":
                    _entity.ContentId = _entity.Headers[key];
                    break;

                case "content-transfer-encoding":
                    _entity.TransferEncoding        = _entity.Headers[key];
                    _entity.ContentTransferEncoding = MimeReader.GetTransferEncoding(_entity.Headers[key]);
                    break;

                case "content-type":
                    _entity.SetContentType(MimeReader.GetContentType(_entity.Headers[key]));
                    break;

                case "mime-version":
                    _entity.MimeVersion = _entity.Headers[key];
                    break;
                }
            }
        }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MimeEntity"/> class.
 /// </summary>
 public MimeEntity()
 {
     _children       = new List <MimeEntity>();
     _headers        = new NameValueCollection();
     _contentType    = MimeReader.GetContentType(string.Empty);
     _parent         = null;
     _encodedMessage = new StringBuilder();
 }