AttachmentCollection Class
Represents a collection of MailMessage attachments.
public sealed class AttachmentCollection : ICollection<Attachment>, IEnumerable<Attachment>, IEnumerable
Public NotInheritable Class AttachmentCollection
Implements ICollection(Of Attachment), IEnumerable(Of Attachment), IEnumerable
- Inheritance:
- System.ObjectAttachmentCollection
Implements
Properties
Count
Gets the count.
Property Value
- System.Int32
The count.
Item[Int32]
Gets the Attachment at the specified index.
public Attachment this[int index] { get; }
Public ReadOnly Property Item(index As Integer) As Attachment
Parameters
index
- System.Int32
The index.
Property Value
The Attachment.
Methods
Add(Attachment)
Adds the specified Attachment item.
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.
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
Contains(Attachment)
Determines whether this AttachmentCollection contains the specified Attachment item.
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.
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.
Parameters
item
- Attachment
The Attachment item.
Returns
- System.Boolean
True
if item is successfully removed; otherwise, false
.