Exemplo n.º 1
0
        private void OnNewMessageWasSent(MessagesUI.MessageNewMyMessageWasSent message)
        {
            try
            {
                var dialogRecipient = this.Dialogs.FirstOrDefault(x => x.EntityModel.User.Uid == message.Sender.Recipient.Uid);
                if (dialogRecipient.HasNotValue())
                {
                    return;
                }

                dialogRecipient.Content = message.Sender.Content;
            }
            catch (Exception ex)
            {
            }
        }
        private void OnMessageNewMyMessageWasSent(MessagesUI.MessageNewMyMessageWasSent msg)
        {
            try
            {
                var message = new Message()
                {
                    Sender    = msg.Sender.Sender,
                    Content   = msg.Sender.Content,
                    Recipient = msg.Sender.Recipient
                };

                this.Messages.Insert(0, new MessageVm(message)
                {
                    Name = msg.Sender.Sender.Uid == modUser.Uid ?
                           String.Format("{0} {1}", modUser.FirstName, modUser.LastName) :
                           String.Format("{0} {1}", modFriend.FirstName, modFriend.LastName)
                });
            }
            catch (Exception ex)
            {
            }
        }