public class MapiAttachmentCollection extends com.aspose.ms.System.Collections.ObjectModel.Collection<MapiAttachment>
Represents a collection of MapiAttachment objects.
Constructor and Description |
---|
MapiAttachmentCollection()
Initializes a new instance of the
MapiAttachmentCollection class. |
MapiAttachmentCollection(MapiMessageItemBase owner)
Initializes a new instance of the MapiAttachmentCollection class.
|
Modifier and Type | Method and Description |
---|---|
void |
add(String name,
byte[] data)
Adds the new attachment.
|
void |
add(String name,
MapiMessage msg)
Adds the new attachment as embedded message.
|
void |
addMapiAttachment(MapiAttachment item)
Adds an object to the end of the
T:System.Collections.ObjectModel.Collection`1 . |
void |
insert(int index,
String name,
MapiMessage msg)
Inserts a message as attachment into the
MapiAttachmentCollection at the specified index. |
void |
insertMapiAttachment(int index,
MapiAttachment item)
Inserts an element into the
T:System.Collections.ObjectModel.Collection`1 at the specified index. |
void |
removeAt(int index)
Removes the element at the specified index of the MapiAttachmentCollection.
|
boolean |
removeMapiAttachment(MapiAttachment item)
Removes the first occurrence of a specific object from the MapiAttachmentCollection.
|
void |
replace(int index,
String name,
MapiMessage msg)
Replaces an element at the specified index.
|
public MapiAttachmentCollection()
Initializes a new instance of the MapiAttachmentCollection
class.
public MapiAttachmentCollection(MapiMessageItemBase owner)
Initializes a new instance of the MapiAttachmentCollection class.
owner
- The owner message.public void add(String name, MapiMessage msg)
Adds the new attachment as embedded message.
name
- The name of attachment.msg
- The MapiMessage
that represents the attached message.com.aspose.ms.System.ArgumentNullException
- throws if message is null.public void add(String name, byte[] data)
Adds the new attachment.
name
- The name of attachment.data
- The attachment data.com.aspose.ms.System.ArgumentNullException
- throws if attachment name is null or empty.com.aspose.ms.System.ArgumentNullException
- throws if attachment data is null.public void addMapiAttachment(MapiAttachment item)
Adds an object to the end of the T:System.Collections.ObjectModel.Collection`1
.
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.public void insertMapiAttachment(int index, MapiAttachment item)
Inserts an element into the T:System.Collections.ObjectModel.Collection`1
at the specified index.
index
- The zero-based index at which item
should be inserted.item
- The object to insert. The value can be null for reference types.T:System.ArgumentOutOfRangeException
- index
is less than zero.
-or-
index
is greater than P:System.Collections.ObjectModel.Collection`1.Count
.public void insert(int index, String name, MapiMessage msg)
Inserts a message as attachment into the MapiAttachmentCollection
at the specified index.
index
- The zero-based index at which should be inserted.name
- The name of attachment.msg
- The MapiMessage
that represents the attached message.com.aspose.ms.System.ArgumentNullException
- throws if message is null.public void replace(int index, String name, MapiMessage msg)
Replaces an element at the specified index.
index
- The zero-based index at which should be replaced.name
- The name of attachment.msg
- The MapiMessage
that represents the attached message.com.aspose.ms.System.ArgumentNullException
- throws if message is null.public void removeAt(int index)
Removes the element at the specified index of the MapiAttachmentCollection.
removeAt
in interface com.aspose.ms.System.Collections.Generic.IGenericList<MapiAttachment>
removeAt
in class com.aspose.ms.System.Collections.ObjectModel.Collection<MapiAttachment>
index
- he zero-based index of the element to remove.public boolean removeMapiAttachment(MapiAttachment item)
Removes the first occurrence of a specific object from the MapiAttachmentCollection.
item
- The object to remove from the MapiAttachmentCollection.Copyright (c) 2008-2017 Aspose Pty Ltd. All Rights Reserved.