C# Class LumiSoft.Net.Mime.HeaderFieldCollection

Mime entity header fields collection.
Inheritance: IEnumerable
显示文件 Open project: jeske/StepsDB-alpha Class Usage Examples

Public Methods

Method Description
Add ( HeaderField headerField ) : void

Adds specified heade field to the end of the collection.

Add ( string fieldName, string value ) : void

Adds a new header field with specified name and value to the end of the collection.

Clear ( ) : void

Clears the collection of all header fields.

Contains ( HeaderField headerField ) : bool

Gets if collection contains specified header field.

Contains ( string fieldName ) : bool

Gets if collection contains specified header field.

Get ( string fieldName ) : LumiSoft.Net.Mime.HeaderField[]

Gets header fields with specified name, returns null if specified field doesn't exist.

GetEnumerator ( ) : IEnumerator

Gets enumerator.

GetFirst ( string fieldName ) : HeaderField

Gets first header field with specified name, returns null if specified field doesn't exist.

HeaderFieldCollection ( ) : System

Default constructor.

Insert ( int index, string fieldName, string value ) : void

Inserts a new header field into the collection at the specified location.

Parse ( Stream stream ) : void

Parses header fields from stream. Stream position stays where header reading ends.

Parse ( string headerString ) : void

Parses header fields from string.

Remove ( HeaderField field ) : void

Removes specified header field from the collection.

Remove ( int index ) : void

Removes header field at the specified index from the collection.

RemoveAll ( string fieldName ) : void

Removes all header fields with specified name from the collection.

ToHeaderString ( string encodingCharSet ) : string

Converts header fields to rfc 2822 message header string.

this ( int index ) : HeaderField

Gets header field from specified index.

Private Methods

Method Description
EncodeHeaderField ( string text ) : string

Encodes header field with quoted-printable encoding, if value contains ANSI or UNICODE chars.

Method Details

Add() public method

Adds specified heade field to the end of the collection.
public Add ( HeaderField headerField ) : void
headerField HeaderField Header field.
return void

Add() public method

Adds a new header field with specified name and value to the end of the collection.
public Add ( string fieldName, string value ) : void
fieldName string Header field name.
value string Header field value.
return void

Clear() public method

Clears the collection of all header fields.
public Clear ( ) : void
return void

Contains() public method

Gets if collection contains specified header field.
public Contains ( HeaderField headerField ) : bool
headerField HeaderField Header field.
return bool

Contains() public method

Gets if collection contains specified header field.
public Contains ( string fieldName ) : bool
fieldName string Header field name.
return bool

Get() public method

Gets header fields with specified name, returns null if specified field doesn't exist.
public Get ( string fieldName ) : LumiSoft.Net.Mime.HeaderField[]
fieldName string Header field name.
return LumiSoft.Net.Mime.HeaderField[]

GetEnumerator() public method

Gets enumerator.
public GetEnumerator ( ) : IEnumerator
return IEnumerator

GetFirst() public method

Gets first header field with specified name, returns null if specified field doesn't exist.
public GetFirst ( string fieldName ) : HeaderField
fieldName string Header field name.
return HeaderField

HeaderFieldCollection() public method

Default constructor.
public HeaderFieldCollection ( ) : System
return System

Insert() public method

Inserts a new header field into the collection at the specified location.
public Insert ( int index, string fieldName, string value ) : void
index int The location in the collection where you want to add the header field.
fieldName string Header field name.
value string Header field value.
return void

Parse() public method

Parses header fields from stream. Stream position stays where header reading ends.
public Parse ( Stream stream ) : void
stream Stream Stream from where to parse.
return void

Parse() public method

Parses header fields from string.
public Parse ( string headerString ) : void
headerString string Header string.
return void

Remove() public method

Removes specified header field from the collection.
public Remove ( HeaderField field ) : void
field HeaderField Header field to remove.
return void

Remove() public method

Removes header field at the specified index from the collection.
public Remove ( int index ) : void
index int The index of the header field to remove.
return void

RemoveAll() public method

Removes all header fields with specified name from the collection.
public RemoveAll ( string fieldName ) : void
fieldName string Header field name.
return void

ToHeaderString() public method

Converts header fields to rfc 2822 message header string.
public ToHeaderString ( string encodingCharSet ) : string
encodingCharSet string CharSet to use for non ASCII header field values. Utf-8 is recommended value, if you explicity don't need other.
return string

this() public method

Gets header field from specified index.
public this ( int index ) : HeaderField
index int
return HeaderField