MimeHeaderCollection Class
The header fields of a message or of a MIME part, in their order. The names are compared ignoring case.
public sealed class MimeHeaderCollection : IEnumerable<MimeHeader>, IReadOnlyCollection<MimeHeader>, IReadOnlyList<MimeHeader>, IEnumerable- Implements
Constructors
| Name | Description |
|---|---|
| MimeHeaderCollection() |
MimeHeaderCollection()
MimeHeaderCollection.cspublic MimeHeaderCollection()No documentation is available.
Properties
| Name | Description |
|---|---|
| Count | Gets the number of headers. |
Indexers
| Name | Description |
|---|---|
| this[int] | Gets a header from its position. |
| this[string] | Gets the decoded value of the first header with a name, or null. |
Item overloads
this[int]
MimeHeaderCollection.csGets a header from its position.
public MimeHeader this[int index] { get; }this[string]
MimeHeaderCollection.csMethods
| Name | Description |
|---|---|
| Add(MimeHeader) | Adds a header at the end. |
| Add(string, string) | Adds a header whose value is a text, encoded when it is not ASCII. |
| Find(string) | Returns the first header with a name. |
| FindAll(string) | Returns the headers with a name, in their order. |
| GetEnumerator() | Returns an enumerator that iterates through the collection. |
| Remove(MimeHeader) | Removes a header. |
| RemoveAll(string) | Removes the headers with a name. |
| Set(string, MimeHeader?) | Replaces the headers with a name by one header, at the position of the first one, or removes them when the value is null. |
| Set(string, string?) | Replaces the headers with a name by a text value, or removes them when the value is null. |
| System.Collections.IEnumerable.GetEnumerator() |
Find(string)
MimeHeaderCollection.csReturns the first header with a name.
public MimeHeader? Find(string name)FindAll(string)
MimeHeaderCollection.csReturns the headers with a name, in their order.
public IEnumerable<MimeHeader> FindAll(string name)GetEnumerator()
MimeHeaderCollection.csReturns an enumerator that iterates through the collection.
public IEnumerator<MimeHeader> GetEnumerator()Returns
IEnumerator<MimeHeader> An enumerator that can be used to iterate through the collection.
Remove(MimeHeader)
MimeHeaderCollection.csRemoves a header.
public bool Remove(MimeHeader header)RemoveAll(string)
MimeHeaderCollection.csSet overloads
Set(string, MimeHeader?)
MimeHeaderCollection.csReplaces the headers with a name by one header, at the position of the first one, or removes them when the value is null.
public void Set(string name, MimeHeader? header)Parameters
namestring- The name of the headers to replace.
headerMimeHeader?- The header, or
nullto remove the headers.