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

    Show / Hide Table of Contents

    MultipartEntity Class

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

    Represents MIME entity with multiple body parts.

    • C#
    • VB.NET
    public sealed class MultipartEntity : Entity, IList<Entity>, ICollection<Entity>, IEnumerable<Entity>, IEnumerable
    Public NotInheritable Class MultipartEntity
        Inherits Entity
        Implements IList(Of Entity), ICollection(Of Entity), IEnumerable(Of Entity), IEnumerable
    Inheritance:
    System.Object
    Entity
    MultipartEntity
    Implements
    System.Collections.Generic.IList<Entity>
    System.Collections.Generic.ICollection<Entity>
    System.Collections.Generic.IEnumerable<Entity>
    System.Collections.IEnumerable

    Constructors

    MultipartEntity(String)

    Initializes a new instance of the MultipartEntity class with specified media subtype.

    • C#
    • VB.NET
    public MultipartEntity(string mediaSubtype)
    Public Sub New(mediaSubtype As String)
    Parameters
    mediaSubtype
    System.String

    The media subtype.

    MultipartEntity(String, IEnumerable<Entity>)

    Initializes a new instance of the MultipartEntity class with specified media subtype and collection of child entities.

    • C#
    • VB.NET
    public MultipartEntity(string mediaSubtype, IEnumerable<Entity> items)
    Public Sub New(mediaSubtype As String, items As IEnumerable(Of Entity))
    Parameters
    mediaSubtype
    System.String

    The media subtype.

    items
    System.Collections.Generic.IEnumerable<Entity>

    The collection of child entities.

    Exceptions
    System.ArgumentNullException

    Child collection is null.

    System.ArgumentException

    Child collection contains null elements.

    Properties

    Boundary

    Gets or sets the boundary.

    • C#
    • VB.NET
    public string Boundary { get; set; }
    Public Property Boundary As String
    Property Value
    System.String

    The boundary.

    Exceptions
    System.ArgumentException

    Boundary is null or empty.

    Count

    Gets the count.

    • C#
    • VB.NET
    public int Count { get; }
    Public ReadOnly Property Count As Integer
    Property Value
    System.Int32

    The count.

    Epilogue

    Gets or sets the entity epilogue.

    • C#
    • VB.NET
    public byte[] Epilogue { get; set; }
    Public Property Epilogue As Byte()
    Property Value
    System.Byte[]

    The entity epilogue.

    IsMultipart

    Gets a value indicating whether this entity is multipart.

    • C#
    • VB.NET
    public override bool IsMultipart { get; }
    Public Overrides ReadOnly Property IsMultipart As Boolean
    Property Value
    System.Boolean

    True if this instance is multipart; otherwise, false.

    Overrides
    Entity.IsMultipart

    Item[Int32]

    Gets or sets the Entity at the specified index.

    • C#
    • VB.NET
    public Entity this[int index] { get; set; }
    Public Property Item(index As Integer) As Entity
    Parameters
    index
    System.Int32

    The index.

    Property Value
    Entity

    The Entity.

    Exceptions
    System.ArgumentNullException

    value

    Preamble

    Gets or sets the entity preamble.

    • C#
    • VB.NET
    public byte[] Preamble { get; set; }
    Public Property Preamble As Byte()
    Property Value
    System.Byte[]

    The entity preamble.

    Methods

    Add(Entity)

    Adds the specified Entity item.

    • C#
    • VB.NET
    public void Add(Entity item)
    Public Sub Add(item As Entity)
    Parameters
    item
    Entity

    The Entity item.

    Clear()

    Removes all the items from this MultipartEntity.

    • C#
    • VB.NET
    public void Clear()
    Public Sub Clear

    Clone()

    Creates a copy of this MultipartEntity instance.

    • C#
    • VB.NET
    public override Entity Clone()
    Public Overrides Function Clone As Entity
    Returns
    Entity

    The copy of this MultipartEntity instance.

    Overrides
    Entity.Clone()

    Contains(Entity)

    Determines whether this MultipartEntity contains the specified Entity item.

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

    The Entity item.

    Returns
    System.Boolean

    True if Entity item is found; otherwise, false.

    CopyTo(Entity[], Int32)

    Copies this MultipartEntity or a portion of it to an array.

    • C#
    • VB.NET
    public void CopyTo(Entity[] array, int arrayIndex)
    Public Sub CopyTo(array As Entity(), arrayIndex As Integer)
    Parameters
    array
    Entity[]

    The one-dimensional Entity array that is the destination of the items copied from this MultipartEntity.

    arrayIndex
    System.Int32

    The zero-based index in array at which copying begins.

    Find(Func<Entity, Boolean>)

    Checks if this MultipartEntity instance or one of its children satisfies a condition.

    • C#
    • VB.NET
    public override Entity Find(Func<Entity, bool> predicate)
    Public Overrides Function Find(predicate As Func(Of Entity, Boolean)) As Entity
    Parameters
    predicate
    System.Func<Entity, System.Boolean>

    A function to test each element for a condition.

    Returns
    Entity

    MultipartEntity instance which satisfies a condition; otherwise, null.

    Overrides
    Entity.Find(Func<Entity, Boolean>)

    IndexOf(Entity)

    Searches for the specified Entity item and returns the zero-based index of the first occurrence within this MultipartEntity.

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

    The Entity item.

    Returns
    System.Int32

    The zero-based index of the first occurrence of Entity item within this MultipartEntity, if found; otherwise, –1.

    Insert(Int32, Entity)

    Inserts an Entity item at the specified index.

    • C#
    • VB.NET
    public void Insert(int index, Entity item)
    Public Sub Insert(index As Integer, item As Entity)
    Parameters
    index
    System.Int32

    The index.

    item
    Entity

    The Entity item.

    Exceptions
    System.ArgumentNullException

    Entity item is null.

    System.ArgumentException

    Collection already contains Entity item.

    Remove(Entity)

    Removes the specified Entity item.

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

    The Entity item.

    Returns
    System.Boolean

    True if item is successfully removed; otherwise, false.

    RemoveAt(Int32)

    Removes the Entity item at the specified index.

    • C#
    • VB.NET
    public void RemoveAt(int index)
    Public Sub RemoveAt(index As Integer)
    Parameters
    index
    System.Int32

    The zero-based index of the Entity item to remove.

    Inherited Properties

    ContentType

    Gets the Content-Type header value.

    (Inherited from Entity)

    Headers

    Gets the Entity headers.

    (Inherited from Entity)

    Parent

    Gets the Entity parent.

    (Inherited from Entity)

    Inherited Methods

    Find(MediaType)

    Checks if this Entity instance or one of its children matches the specified content type.

    (Inherited from Entity)

    Find(System.String)

    Checks if this Entity instance or one of its children matches the specified top level media type.

    (Inherited from Entity)

    Implements

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

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.