MailMessageCollectionReverse Method
Reverses the order of the list of the messages that are stored in the collection.

Namespace: MailBee.Mime
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax
public void Reverse()
Remarks
For instance, this method can be used to display the list of message received from mail server in descending order (from new to old ones). By default, mail server returns messages in ascending order (from old to new ones). This method allows the developer to have this collection re-sorted in descending order.
Examples
The sample creates new collection, loads 4 messages from .EML files, adds these messages to the collection, and displays the subjects of these messages. Then, the collection is reversed and the subjects of the messages are shown again (in reverse order).
// To use the code below, import MailBee namespaces at the top of your code.
using MailBee;
using MailBee.Mime;

// The actual code (put it into a method of your class).
MailMessageCollection msgColl = new MailMessageCollection();
MailMessage msg = new MailMessage();
for (int i = 1; i < 5; i++)
{
    msg.LoadMessage(string.Format(@"C:\Docs\TestMail{0}.eml", i));
    msgColl.Add(msg);
}
foreach (MailMessage m in msgColl)
{
    Console.WriteLine(m.Subject);
}
msgColl.Reverse();
foreach (MailMessage m in msgColl)
{
    Console.WriteLine(m.Subject);
}
See Also