using System; using System.Collections.ObjectModel; using System.Text; namespace System.Net.Mail { /// Store e-mail addresses that are associated with an e-mail message. // Token: 0x0200013F RID: 319 public class MailAddressCollection : Collection { /// Add a list of e-mail addresses to the collection. /// The e-mail addresses to add to the . Multiple e-mail addresses must be separated with a comma character (","). /// The parameter is null. /// The parameter is an empty string. /// The parameter contains an e-mail address that is invalid or not supported. // Token: 0x06000ADB RID: 2779 RVA: 0x000207B8 File Offset: 0x0001E9B8 public void Add(string addresses) { foreach (string text in addresses.Split(new char[] { ',' })) { this.Add(new MailAddress(text)); } } /// Inserts an e-mail address into the , at the specified location. /// The location at which to insert the e-mail address that is specified by . /// The e-mail address to be inserted into the collection. /// The parameter is null. // Token: 0x06000ADC RID: 2780 RVA: 0x000207FC File Offset: 0x0001E9FC protected override void InsertItem(int index, MailAddress item) { if (item == null) { throw new ArgumentNullException(); } base.InsertItem(index, item); } /// Replaces the element at the specified index. /// The index of the e-mail address element to be replaced. /// An e-mail address that will replace the element in the collection. /// The parameter is null. // Token: 0x06000ADD RID: 2781 RVA: 0x00020814 File Offset: 0x0001EA14 protected override void SetItem(int index, MailAddress item) { if (item == null) { throw new ArgumentNullException(); } base.SetItem(index, item); } /// Returns a string representation of the e-mail addresses in this object. /// A containing the e-mail addresses in this collection. // Token: 0x06000ADE RID: 2782 RVA: 0x0002082C File Offset: 0x0001EA2C public override string ToString() { StringBuilder stringBuilder = new StringBuilder(); for (int i = 0; i < this.Count; i++) { if (i > 0) { stringBuilder.Append(", "); } stringBuilder.Append(this[i].ToString()); } return stringBuilder.ToString(); } } }