C# Class Papercut.Smtp.Mime.MimeReader

This class is responsible for parsing a string array of lines containing a MIME message.
ファイルを表示 Open project: wiggle/papercut-web Class Usage Examples

Public Methods

Method Description
CreateMimeEntity ( ) : MimeEntity

Creates the MIME entity.

GetContentType ( string contentType ) : ContentType

Gets the type of the content.

GetMediaMainType ( string mediaType ) : string

Gets the type of the media main.

GetMediaSubType ( string mediaType ) : string

Gets the type of the media sub.

GetMediaType ( string mediaType ) : string

Gets the type of the media.

GetTransferEncoding ( string transferEncoding ) : TransferEncoding

Gets the transfer encoding.

The transfer encoding determination follows the same rules as Peter Huber's article w/ the exception of not throwing exceptions when binary is provided as a transferEncoding. Instead it is left to the calling code to check for binary.

MimeReader ( IEnumerable lines ) : System

Initializes a new instance of the MimeReader class.

Private Methods

Method Description
AddChildEntity ( MimeEntity entity, Queue lines ) : void

Adds the child entity.

GetBytes ( string content ) : byte[]

Gets a byte[] of content for the provided string.

MimeReader ( ) : System

Prevents a default instance of the MimeReader class from being created.

MimeReader ( MimeEntity entity, Queue lines ) : System

Initializes a new instance of the MimeReader class.

ParseBody ( ) : void

Parses the body.

ParseHeaders ( ) : int

Parse headers into _entity.Headers NameValueCollection.

ProcessHeaders ( ) : void

Processes mime specific headers.

SetDecodedContentStream ( ) : void

Sets the decoded content stream by decoding the EncodedMessage and writing it to the entity content stream.

Method Details

CreateMimeEntity() public method

Creates the MIME entity.
public CreateMimeEntity ( ) : MimeEntity
return MimeEntity

GetContentType() public static method

Gets the type of the content.
public static GetContentType ( string contentType ) : ContentType
contentType string /// Type of the content. ///
return System.Net.Mime.ContentType

GetMediaMainType() public static method

Gets the type of the media main.
public static GetMediaMainType ( string mediaType ) : string
mediaType string /// Type of the media. ///
return string

GetMediaSubType() public static method

Gets the type of the media sub.
public static GetMediaSubType ( string mediaType ) : string
mediaType string /// Type of the media. ///
return string

GetMediaType() public static method

Gets the type of the media.
public static GetMediaType ( string mediaType ) : string
mediaType string /// Type of the media. ///
return string

GetTransferEncoding() public static method

Gets the transfer encoding.
The transfer encoding determination follows the same rules as Peter Huber's article w/ the exception of not throwing exceptions when binary is provided as a transferEncoding. Instead it is left to the calling code to check for binary.
public static GetTransferEncoding ( string transferEncoding ) : TransferEncoding
transferEncoding string /// The transfer encoding. ///
return TransferEncoding

MimeReader() public method

Initializes a new instance of the MimeReader class.
public MimeReader ( IEnumerable lines ) : System
lines IEnumerable /// The lines. ///
return System