internal static List<MailAddress> ParseMultipleAddresses(string data)
{
List<MailAddress> results = new List<MailAddress>();
int index = data.Length - 1;
while (index >= 0)
{
// Because we're parsing in reverse, we must make an effort to preserve the order of the addresses.
results.Insert(0, MailAddressParser.ParseAddress(data, true, ref index));
Debug.Assert(index == -1 || data[index] == MailBnfHelper.Comma,
"separator not found while parsing multiple addresses");
index--;
}
return results;
}