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

    Show / Hide Table of Contents

    AttachmentCollection Class

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

    Represents a collection of MailMessage attachments.

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

    Properties

    Count

    Gets the count.

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

    The count.

    Item[Int32]

    Gets the Attachment at the specified index.

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

    The index.

    Property Value
    Attachment

    The Attachment.

    Methods

    Add(Attachment)

    Adds the specified Attachment item.

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

    The Attachment item.

    Exceptions
    System.ArgumentNullException

    Item is null.

    System.ArgumentException

    Collection already contains Attachment item.

    AddInline(Attachment)

    Adds the specified Attachment item as an inline entity.

    • C#
    • VB.NET
    public void AddInline(Attachment item)
    Public Sub AddInline(item As Attachment)
    Parameters
    item
    Attachment

    The Attachment item.

    Exceptions
    System.ArgumentNullException

    Item is null.

    System.ArgumentException

    Collection already contains Attachment item.

    Clear()

    Removes all the items from this AttachmentCollection

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

    Contains(Attachment)

    Determines whether this AttachmentCollection contains the specified Attachment item.

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

    The Attachment item.

    Returns
    System.Boolean

    True if Attachment item is found; otherwise, false.

    CopyTo(Attachment[], Int32)

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

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

    The one-dimensional Attachment array that is the destination of the items copied from this AttachmentCollection.

    arrayIndex
    System.Int32

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

    Remove(Attachment)

    Removes the specified Attachment item.

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

    The Attachment item.

    Returns
    System.Boolean

    True if item is successfully removed; otherwise, false.

    Implements

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

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.