Example #1
0
 public void MarkAsUnread(Account account)
 {
     foreach (var messagePerson in MessagePersons.Where(x => x.Account == account))
     {
         messagePerson.IsRead = false;
     }
 }
Example #2
0
        public void AddBcc(Account account)
        {
            _ = account ?? throw new ArgumentNullException(nameof(account));

            if (!MessagePersons.Any(x => x.Type == MessagePersonType.Bcc && x.Account == account))
            {
                MessagePersons.Add(new MessagePerson(account, this, MessagePersonType.Bcc));
            }
        }
Example #3
0
        public void SetSender(Account sender)
        {
            _ = sender ?? throw new ArgumentNullException(nameof(sender));

            var actualReceiver = MessagePersons.FirstOrDefault(x => x.Type == MessagePersonType.Sender);

            if (actualReceiver != null)
            {
                MessagePersons.Remove(actualReceiver);
            }
            MessagePersons.Add(new MessagePerson(sender, this, MessagePersonType.Sender));
        }
Example #4
0
 public bool IsRead(Account account) =>
 MessagePersons.Where(x => x.Account == account).Any(x => x.IsRead);