Class MimeHeaderCollection
A collection of MimeHeader objects. Header names are case-insensitive.
Inherited Members
Namespace: DRIT.Mail.Rfc.Mime
Assembly: DRIT.Mail.dll
Syntax
public sealed class MimeHeaderCollection : IEnumerable<MimeHeader>, IEnumerable
Constructors
View SourceMimeHeaderCollection()
Initializes a new instance of the MimeHeaderCollection class.
Declaration
public MimeHeaderCollection()
Properties
View Sourcethis[string]
Gets the first header with the specified name, or null if not found.
Declaration
public MimeHeader? this[string name] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| string | name |
Property Value
| Type | Description |
|---|---|
| MimeHeader |
Methods
View SourceAdd(MimeHeader)
Adds a header to the collection.
Declaration
public void Add(MimeHeader header)
Parameters
| Type | Name | Description |
|---|---|---|
| MimeHeader | header | Specifies the header value. |
Contains(string)
Determines whether a header with the specified name exists.
Declaration
public bool Contains(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Specifies the name value. |
Returns
| Type | Description |
|---|---|
| bool |
GetAll(string)
Gets all headers with the specified name.
Declaration
public IReadOnlyList<MimeHeader> GetAll(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Specifies the name value. |
Returns
| Type | Description |
|---|---|
| IReadOnlyList<MimeHeader> |
GetEnumerator()
Gets the enumerator.
Declaration
public IEnumerator<MimeHeader> GetEnumerator()
Returns
| Type | Description |
|---|---|
| IEnumerator<MimeHeader> |
GetValue(string)
Gets the primary value of the first header with the specified name, or null.
Declaration
public string? GetValue(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Specifies the name value. |
Returns
| Type | Description |
|---|---|
| string |
Remove(string)
Removes all headers with the specified name.
Declaration
public void Remove(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Specifies the name value. |
Set(MimeHeader)
Replaces all headers with the same name with the specified header.
Declaration
public void Set(MimeHeader header)
Parameters
| Type | Name | Description |
|---|---|---|
| MimeHeader | header | Specifies the header value. |