internal MimeMessage(ParserOptions options, IEnumerable <Header> headers) { addresses = new Dictionary <string, InternetAddressList> (icase); Headers = new HeaderList(options); // initialize our address lists foreach (var name in StandardAddressHeaders) { var list = new InternetAddressList(); list.Changed += InternetAddressListChanged; addresses.Add(name, list); } references = new MessageIdList(); references.Changed += ReferencesChanged; inreplyto = null; Headers.Changed += HeadersChanged; // add all of our message headers... foreach (var header in headers) { if (header.Field.StartsWith("Content-", StringComparison.OrdinalIgnoreCase)) { continue; } Headers.Add(header); } }
/// <summary> /// Clones the <see cref="MessageIdList"/>. /// </summary> /// <remarks> /// Creates an exact copy of the <see cref="MessageIdList"/>. /// </remarks> /// <returns>An exact copy of the <see cref="MessageIdList"/>.</returns> public MessageIdList Clone() { var clone = new MessageIdList(); for (int i = 0; i < references.Count; i++) { clone.references.Add(references[i]); } return(clone); }
internal MimeMessage(ParserOptions options) { addresses = new Dictionary <string, InternetAddressList> (icase); Headers = new HeaderList(options); // initialize our address lists foreach (var name in StandardAddressHeaders) { var list = new InternetAddressList(); list.Changed += InternetAddressListChanged; addresses.Add(name, list); } references = new MessageIdList(); references.Changed += ReferencesChanged; inreplyto = null; Headers.Changed += HeadersChanged; }