internal void Update(Message imapMsg) { this.origin = imapMsg; this.attachmentsCache = null; UID = origin.UId.ToString(); MsgID = origin.MessageId; Date = origin.Date; Subject = RemoveNeedless(origin.Subject); From = new MailboxList(); From.Add(new Mailbox { DisplayName = origin.From.DisplayName, Address = origin.From.Address }); if (origin.To != null && origin.To.Count > 0) { if (To != null) { To.Clear(); } else { To = new AddressList(); } foreach (var address in origin.To) { To.Add(address.Address); } } else { this.To = null; } if (origin.Cc != null && origin.Cc.Count > 0) { if (Cc != null) { Cc.Clear(); } else { Cc = new AddressList(); } foreach (var address in origin.Cc) { this.Cc.Add(address.ToString()); } } else { this.Cc = null; } this.attachmentsCache = null; }