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:
- System.ObjectMultipartEntity
Implements
Constructors
MultipartEntity(String)
Initializes a new instance of the MultipartEntity class with specified media subtype.
Parameters
mediaSubtype
- System.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
- System.String
The media subtype.
items
- System.Collections.Generic.IEnumerable<Entity>
The collection of child entities.
Exceptions
- System.ArgumentNullException
Child collection is null.
- System.ArgumentException
Child collection contains null elements.
Properties
Boundary
Gets or sets the boundary.
Property Value
- System.String
The boundary.
Exceptions
- System.ArgumentException
Boundary is null or empty.
Count
Gets the count.
Property Value
- System.Int32
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
- System.Boolean
True
if this instance is multipart; otherwise, false
.
Overrides
Item[Int32]
Gets or sets the Entity at the specified index.
Parameters
index
- System.Int32
The index.
Property Value
Exceptions
- System.ArgumentNullException
value
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
- System.Boolean
True
if Entity item is found; otherwise, false
.
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
- System.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
predicate
- System.Func<Entity, System.Boolean>
A function to test each element for a condition.
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
- System.Int32
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
- System.Int32
The index.
Exceptions
- System.ArgumentNullException
Entity item is null.
- System.ArgumentException
Collection already contains Entity item.
Remove(Entity)
Removes the specified Entity item.
Parameters
Returns
- System.Boolean
True
if item is successfully removed; otherwise, false
.
RemoveAt(Int32)
Removes the Entity item at the specified index.
Parameters
index
- System.Int32
The zero-based index of the Entity item to remove.
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(System.String) | Checks if this Entity instance or one of its children matches the specified top level media type. (Inherited from Entity) |