GemBox.Email
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    HeaderCollection Class

    Namespace:
    GemBox.Email.Mime
    Assembly:
    GemBox.Email.dll

    Represents a collection of MIME Header elements.

    • C#
    • VB.NET
    public sealed class HeaderCollection : Collection<Header>, IList<Header>, ICollection<Header>, IList, ICollection, IReadOnlyList<Header>, IReadOnlyCollection<Header>, IEnumerable<Header>, IEnumerable
    Public NotInheritable Class HeaderCollection
        Inherits Collection(Of Header)
        Implements IList(Of Header), ICollection(Of Header), IList, ICollection, IReadOnlyList(Of Header), IReadOnlyCollection(Of Header), IEnumerable(Of Header), IEnumerable
    Inheritance:
    System.Object
    System.Collections.ObjectModel.Collection<Header>
    HeaderCollection
    Implements
    System.Collections.Generic.IList<Header>
    System.Collections.Generic.ICollection<Header>
    System.Collections.IList
    System.Collections.ICollection
    System.Collections.Generic.IReadOnlyList<Header>
    System.Collections.Generic.IReadOnlyCollection<Header>
    System.Collections.Generic.IEnumerable<Header>
    System.Collections.IEnumerable

    Properties

    Item[HeaderId]

    Gets the Header with the specified identifier.

    • C#
    • VB.NET
    public Header this[HeaderId id] { get; }
    Public ReadOnly Property Item(id As HeaderId) As Header
    Parameters
    id
    HeaderId

    The identifier.

    Property Value
    Header

    The Header with the specified identifier.

    Exceptions
    System.InvalidOperationException

    Header with the specified identifier doesn't exist.

    Item[String]

    Gets the Header with the specified name.

    • C#
    • VB.NET
    public Header this[string name] { get; }
    Public ReadOnly Property Item(name As String) As Header
    Parameters
    name
    System.String

    The name.

    Property Value
    Header

    The Header with the specified name.

    Exceptions
    System.ArgumentException

    Name is null or empty.

    System.InvalidOperationException

    Header with the specified name doesn't exist.

    Methods

    Contains(HeaderId)

    Determines whether this HeaderCollection contains Header with specified identifier.

    • C#
    • VB.NET
    public bool Contains(HeaderId id)
    Public Function Contains(id As HeaderId) As Boolean
    Parameters
    id
    HeaderId

    The identifier.

    Returns
    System.Boolean

    True if this HeaderCollection contains the Header; otherwise, false.

    IndexOf(HeaderId)

    Searches for the Header with specified identifier and returns the zero-based index of the first occurrence within this HeaderCollection.

    • C#
    • VB.NET
    public int IndexOf(HeaderId id)
    Public Function IndexOf(id As HeaderId) As Integer
    Parameters
    id
    HeaderId

    The identifier.

    Returns
    System.Int32

    The zero-based index of the first occurrence of Header within this HeaderCollection, if found; otherwise, –1.

    Remove(HeaderId)

    Removes the Header with the specified identifier.

    • C#
    • VB.NET
    public bool Remove(HeaderId id)
    Public Function Remove(id As HeaderId) As Boolean
    Parameters
    id
    HeaderId

    The identifier.

    Returns
    System.Boolean

    True if item is successfully removed; otherwise, false.

    Remove(String)

    Removes the Header with the specified name.

    • C#
    • VB.NET
    public bool Remove(string name)
    Public Function Remove(name As String) As Boolean
    Parameters
    name
    System.String

    The name.

    Returns
    System.Boolean

    True if item is successfully removed; otherwise, false.

    TryGetHeader(HeaderId, out Header)

    Tries the get a Header with the specified identifier.

    • C#
    • VB.NET
    public bool TryGetHeader(HeaderId id, out Header value)
    Public Function TryGetHeader(id As HeaderId, ByRef value As Header) As Boolean
    Parameters
    id
    HeaderId

    The identifier.

    value
    Header

    When this method returns, contains the Header with the specified name, if found; otherwise, null.

    Returns
    System.Boolean

    True if this HeaderCollection contains the specified Header; otherwise, false.

    TryGetHeader(String, out Header)

    Tries the get a Header with the specified name.

    • C#
    • VB.NET
    public bool TryGetHeader(string name, out Header value)
    Public Function TryGetHeader(name As String, ByRef value As Header) As Boolean
    Parameters
    name
    System.String

    The name.

    value
    Header

    When this method returns, contains the Header with the specified name, if found; otherwise, null.

    Returns
    System.Boolean

    True if this HeaderCollection contains the specified Header; otherwise, false.

    Exceptions
    System.ArgumentNullException

    Name is null or empty.

    Implements

    System.Collections.Generic.IList<T>
    System.Collections.Generic.ICollection<T>
    System.Collections.IList
    System.Collections.ICollection
    System.Collections.Generic.IReadOnlyList<T>
    System.Collections.Generic.IReadOnlyCollection<T>
    System.Collections.Generic.IEnumerable<T>
    System.Collections.IEnumerable
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.