MapiAttachmentCollection

Inheritance: java.lang.Object, com.aspose.ms.System.Collections.Generic.List

public class MapiAttachmentCollection extends System.Collections.Generic.List<MapiAttachment>

Represents a collection of MapiAttachment objects.

Constructors

Constructor Description
MapiAttachmentCollection() Initializes a new instance of the MapiAttachmentCollection class.
MapiAttachmentCollection(MapiMessageItemBase owner) Initializes a new instance of the MapiAttachmentCollection class.

Methods

Method Description
add(String name, MapiMessage msg) Adds the new attachment as embedded message.
add(String name, byte[] data) Adds the new attachment.
addMapiAttachment(MapiAttachment item) Adds an object to the end of the ``` System.Collections.ObjectModel.Collection`1 ```.
insertMapiAttachment(int index, MapiAttachment item) Inserts an element into the ``` System.Collections.ObjectModel.Collection`1 ``` at the specified index.
insert(int index, String name, MapiMessage msg) Inserts a message as attachment into the MapiAttachmentCollection at the specified index.
replace(int index, String name, MapiMessage msg) Replaces an element at the specified index.
removeAt(int index) Removes the element at the specified index of the MapiAttachmentCollection.
removeMapiAttachment(MapiAttachment item) Removes the first occurrence of a specific object from the MapiAttachmentCollection.

MapiAttachmentCollection()

public MapiAttachmentCollection()

Initializes a new instance of the MapiAttachmentCollection class.

MapiAttachmentCollection(MapiMessageItemBase owner)

public MapiAttachmentCollection(MapiMessageItemBase owner)

Initializes a new instance of the MapiAttachmentCollection class.

Parameters:

Parameter Type Description
owner MapiMessageItemBase The owner message.

add(String name, MapiMessage msg)

public final void add(String name, MapiMessage msg)

Adds the new attachment as embedded message.

Parameters:

Parameter Type Description
name java.lang.String The name of attachment.
msg MapiMessage The MapiMessage that represents the attached message.

add(String name, byte[] data)

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

Adds the new attachment.

Parameters:

Parameter Type Description
name java.lang.String The name of attachment.
data byte[] The attachment data.

addMapiAttachment(MapiAttachment item)

public final void addMapiAttachment(MapiAttachment item)

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

Parameters:

Parameter Type Description
item MapiAttachment The object to be added to the end of the ``` System.Collections.ObjectModel.Collection`1 ```. The value can be null for reference types.

insertMapiAttachment(int index, MapiAttachment item)

public final void insertMapiAttachment(int index, MapiAttachment item)

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

Parameters:

Parameter Type Description
index int The zero-based index at which ``` item ``` should be inserted.
item MapiAttachment The object to insert. The value can be null for reference types.

insert(int index, String name, MapiMessage msg)

public final void insert(int index, String name, MapiMessage msg)

Inserts a message as attachment into the MapiAttachmentCollection at the specified index.

Parameters:

Parameter Type Description
index int The zero-based index at which should be inserted.
name java.lang.String The name of attachment.
msg MapiMessage The MapiMessage that represents the attached message.

replace(int index, String name, MapiMessage msg)

public final void replace(int index, String name, MapiMessage msg)

Replaces an element at the specified index.

Parameters:

Parameter Type Description
index int The zero-based index at which should be replaced.
name java.lang.String The name of attachment.
msg MapiMessage The MapiMessage that represents the attached message.

removeAt(int index)

public final void removeAt(int index)

Removes the element at the specified index of the MapiAttachmentCollection.

Parameters:

Parameter Type Description
index int he zero-based index of the element to remove.

removeMapiAttachment(MapiAttachment item)

public final boolean removeMapiAttachment(MapiAttachment item)

Removes the first occurrence of a specific object from the MapiAttachmentCollection.

Parameters:

Parameter Type Description
item MapiAttachment The object to remove from the MapiAttachmentCollection.

Returns: boolean - true if item is successfully removed; otherwise, false.