com.aspose.email

com.aspose.email

Class MapiAttachmentCollection

All Implemented Interfaces:
Serializable, Cloneable, Iterable<MapiAttachment>, Collection<MapiAttachment>, List<MapiAttachment>, RandomAccess
public class MapiAttachmentCollection
extends ArrayList<MapiAttachment>

Represents a collection of MapiAttachment objects.

See Also:
Serialized Form

Constructor Summary
MapiAttachmentCollection()
Initializes a new instance of the MapiAttachmentCollection class.
MapiAttachmentCollection(MapiMessage owner)
Initializes a new instance of the MapiAttachmentCollection class.
 
Method Summary
void
add(String name, byte[]data)
Adds the new attachment.
void
addMapiAttachment(MapiAttachment item)
Adds an object to the end of the T:System.Collections.ObjectModel.Collection`1.
void
insertMapiAttachment(intindex, MapiAttachment item)
Inserts an element into the T:System.Collections.ObjectModel.Collection`1 at the specified index.
 
Methods inherited from class java.util.ArrayList
 
Methods inherited from class java.util.AbstractList
 
Methods inherited from class java.util.AbstractCollection
 
Methods inherited from class java.lang.Object
 
Methods inherited from interface java.util.List
 

    • Constructor Detail

      • MapiAttachmentCollection

        public MapiAttachmentCollection()

        Initializes a new instance of the MapiAttachmentCollection class.

      • MapiAttachmentCollection

        public MapiAttachmentCollection(MapiMessage owner)

        Initializes a new instance of the MapiAttachmentCollection class.

        Parameters:
        owner - The owner message.
    • Method Detail

      • add

        public void add(String name,
                        byte[] data)

        Adds the new attachment.

        Parameters:
        name - The name of attachment.
        data - The attachment data.
        Throws:
        com.aspose.email.ms.System.IllegalArgumentException - throws if attachment name is null or empty.
        com.aspose.email.ms.System.IllegalArgumentException - throws if attachment data is null.
      • addMapiAttachment

        public void addMapiAttachment(MapiAttachment item)

        Adds an object to the end of the T:System.Collections.ObjectModel.Collection`1.

        Parameters:
        item - The object to be added to the end of the T:System.Collections.ObjectModel.Collection`1. The value can be null for reference types.
      • insertMapiAttachment

        public void insertMapiAttachment(int index,
                                         MapiAttachment item)

        Inserts an element into the T:System.Collections.ObjectModel.Collection`1 at the specified index.

        Parameters:
        index - The zero-based index at which item should be inserted.
        item - The object to insert. The value can be null for reference types.
        Throws:
        T:System.ArgumentOutOfRangeException - index is less than zero.

        -or-

        index is greater than P:System.Collections.ObjectModel.Collection`1.Count.