MimeIteratorIndex Property

Get the index of the current entity within its parent multipart.

Definition

Namespace: MimeKit
Assembly: MimeKit.Core (in MimeKit.Core.dll) Version: 5.0.0
C#
public int Index { get; }

Property Value

Int32
The index of the current entity within its parent multipart or -1 if the parent is not a multipart.

Remarks

Gets the index of the current entity within its parent Multipart, which can be used to replace or remove the entity (e.g. ((Multipart) iter.Parent).RemoveAt (iter.Index)).

If the current entity is not the child of a Multipart (that is, if it is the body of the top-level message or the body of an attached message), then the index will be -1.

Exceptions

InvalidOperationException Either MoveNext has not been called or MoveNext has moved beyond the end of the message.

See Also