Beispiel #1
0
 public void Update(ContactMessage message)
 {
     _ChangeTextColorOfConversationTxt(true, MessageParser.CreateConversationMessageForUser(conversationTxt.Text, message.GetMessage(),_contact.GetName() + ": "));
     _windowReceiveId = message.GetEmissorId();
     _senderService.SendData(_windowEmissorId, _contact.GetIp(), 13);
     Focus();
 }
        public void UpdateOrCreateWindowIfNeeded(ContactMessage contactMessage)
        {
            if (contactMessage.GetReceiveId() == null)
            {
                var contactSearched = _contactManager.SearchContact(contactMessage.GetEmissorContactName());
                var chatWindow = _mainWindow.GetChatWindow(contactSearched);

                _mainWindow.Invoke((MethodInvoker)delegate () {
                    chatWindow.Show(this);
                    _windows.Last().Value.Update(contactMessage);
                });
            }
            else
            {
                _mainWindow.Invoke((MethodInvoker)delegate () {
                    _windows[contactMessage.GetReceiveId()].Update(contactMessage);
                });
            }
        }
Beispiel #3
0
 public static string ParseMessageToSendIt(ContactMessage contactMessage)
 {
     return JsonConvert.SerializeObject(contactMessage);
 }