/// <summary> /// Intializes the From: adresses field /// </summary> /// <param name="Addr">An array of address</param> public void SetAddressFrom(MailAddress[] Addr) { m_address_from.Clear(); foreach (MailAddress address in Addr) { m_address_from.Add(address); } }
/// <summary> /// Intializes the To: adresses field /// </summary> /// <param name="addr">An array of address</param> public void SetAddressTo(MailAddress[] addr) { m_address_to.Clear(); foreach (MailAddress a in addr) { m_address_to.Add(a); } }
/// <summary> /// Read adresses from header line and add each address in "List" /// </summary> /// <param name="List">The address list to initialize</param> /// <param name="Src">A string containing header line with address list</param> public void ReadAddresses(ref MailAddressList List, string Src) { string[] s = Src.Split(';'); if (s == null) { List.Add(new MailAddress(Src)); } else { foreach (string a in s) { int p; string tmp = a; while ((p = tmp.LastIndexOf("\r\n")) != -1) { tmp = tmp.Remove(p, 2); } List.Add(new MailAddress(tmp)); } } }
public override int Add(MailAddress x) { int result = 0; rwLock.AcquireWriterLock(timeout); try { result = collection.Add(x); } finally { rwLock.ReleaseWriterLock(); } return(result); }