MultipartEntity Class
Represents MIME entity with multiple body parts.
public sealed class MultipartEntity : Entity, IList<Entity>, ICollection<Entity>, IEnumerable<Entity>, IEnumerable
Public NotInheritable Class MultipartEntity
Inherits Entity
Implements IList(Of Entity), ICollection(Of Entity), IEnumerable(Of Entity), IEnumerable
- Inheritance:
- MultipartEntity
Constructors
MultipartEntity(String)
Initializes a new instance of the MultipartEntity class with specified media subtype.
Parameters
mediaSubtype
- String
The media subtype.
MultipartEntity(String, IEnumerable<Entity>)
Initializes a new instance of the MultipartEntity class with specified media subtype and collection of child entities.
public MultipartEntity(string mediaSubtype, IEnumerable<Entity> items)
Public Sub New(mediaSubtype As String, items As IEnumerable(Of Entity))
Parameters
mediaSubtype
- String
The media subtype.
items
- IEnumerable<Entity>
The collection of child entities.
Exceptions
Child collection is null.
Child collection contains null elements.
Properties
Boundary
Gets or sets the boundary.
Property Value
The boundary.
Exceptions
Boundary is null or empty.
Count
Gets the count.
Property Value
The count.
Epilogue
Gets or sets the entity epilogue.
Property Value
- System.Byte[]
The entity epilogue.
IsMultipart
Gets a value indicating whether this entity is multipart.
public override bool IsMultipart { get; }
Public Overrides ReadOnly Property IsMultipart As Boolean
Property Value
True
if this instance is multipart; otherwise, false
.
Overrides
Item[Int32]
Gets or sets the Entity at the specified index.
Parameters
index
- Int32
The index.
Property Value
Exceptions
Preamble
Gets or sets the entity preamble.
Property Value
- System.Byte[]
The entity preamble.
Methods
Add(Entity)
Adds the specified Entity item.
Parameters
Clear()
Removes all the items from this MultipartEntity.
Clone()
Creates a copy of this MultipartEntity instance.
Returns
The copy of this MultipartEntity instance.
Overrides
Contains(Entity)
Determines whether this MultipartEntity contains the specified Entity item.
Parameters
Returns
CopyTo(Entity[], Int32)
Copies this MultipartEntity or a portion of it to an array.
public void CopyTo(Entity[] array, int arrayIndex)
Public Sub CopyTo(array As Entity(), arrayIndex As Integer)
Parameters
array
- Entity[]
The one-dimensional Entity array that is the destination of the items copied from this MultipartEntity.
arrayIndex
- Int32
The zero-based index in array at which copying begins.
Find(Func<Entity, Boolean>)
Checks if this MultipartEntity instance or one of its children satisfies a condition.
public override Entity Find(Func<Entity, bool> predicate)
Public Overrides Function Find(predicate As Func(Of Entity, Boolean)) As Entity
Parameters
Returns
MultipartEntity instance which satisfies a condition; otherwise, null.
Overrides
IndexOf(Entity)
Searches for the specified Entity item and returns the zero-based index of the first occurrence within this MultipartEntity.
Parameters
Returns
The zero-based index of the first occurrence of Entity item within this MultipartEntity, if found; otherwise, –1.
Insert(Int32, Entity)
Inserts an Entity item at the specified index.
public void Insert(int index, Entity item)
Public Sub Insert(index As Integer, item As Entity)
Parameters
index
- Int32
The index.
Exceptions
Entity item is null.
Collection already contains Entity item.
Remove(Entity)
Removes the specified Entity item.
Parameters
Returns
True
if item is successfully removed; otherwise, false
.
RemoveAt(Int32)
Removes the Entity item at the specified index.
Parameters
Inherited Properties
ContentType | Gets the Content-Type header value. (Inherited from Entity) |
Headers | Gets the Entity headers. (Inherited from Entity) |
Parent | Gets the Entity parent. (Inherited from Entity) |
Inherited Methods
Find(MediaType) | Checks if this Entity instance or one of its children matches the specified content type. (Inherited from Entity) |
Find(String) | Checks if this Entity instance or one of its children matches the specified top level media type. (Inherited from Entity) |