MimeIteratorGetEnumerator Method

Get the enumerator.

Definition

Namespace: MimeKit
Assembly: MimeKit.Core (in MimeKit.Core.dll) Version: 5.0.0
C#
public MimeIterator GetEnumerator()

Return Value

MimeIterator
This iterator.

Remarks

Returns this iterator so that it can be used in a foreach statement, which will enumerate the entities that follow the current position (or all of the entities in the message if MoveNext has not yet been called).

Since the iterator itself is used, members such as SkipChildren, PathSpecifier and Depth can be used within the loop body.

Example

C#
                    var iter = new MimeIterator (message);

foreach (var entity in iter) {
    if (entity is MessagePart)
        iter.SkipChildren ();

    Console.WriteLine ("{0}: {1}", iter.PathSpecifier, entity.ContentType.MimeType);
}
                  

See Also