public void SendMessage()
        {
            var messageData = new ConferencialMessageData(ConnectedContactsNumber.ToList(), MessageContent);
            ICommand command = _sendConferenceMessageFactory(messageData);
            CommandInvoker.Invoke(command);

            var myMessage = new ConferencialMessage(0, DateTime.Now, MessageContent, null);
            Messages.Add(new ConferencialMessageViewModel(myMessage, "Me"));
            MessageContent = string.Empty;
        }
        private void ConferenceMessageHandler(IRequest request)
        {
            var messageRequest = (ConferencialMessageRequest)request;
            SendReponse(new ConferencialMessageResponse());

            lock (_conferenceMessages)
            {
                foreach (var receiver in messageRequest.ReciversNumbers)
                {
                    if (receiver == _clientNumber) continue;

                    if (!_conferenceMessages.ContainsKey(receiver))
                    {
                        _conferenceMessages.Add(receiver, new List<ConferencialMessage>());
                    }

                    var message = new ConferencialMessage(_clientNumber,
                                                          DateTime.Now, messageRequest.Text,
                                                          messageRequest.ReciversNumbers);
                    _conferenceMessages[receiver].Add(message);
                }
            }
        }
 public void AddMessage(ConferencialMessage message)
 {
     Messages.Add(new ConferencialMessageViewModel(message,
         _numbersToNamesConverter.Convert(message.SenderNumber)));
 }