private void OnChatSessionClosed(object sender, ChatSessionEventArgs e) { if (e != null && e.Contact != null) { _chatSessions.Remove(e.Contact.Name); } }
private void OnSendMessage(object sender, ChatSessionEventArgs e) { if (e != null) { SendMessage(sender, e); } }
void OnSendMessage(object sender, ChatSessionEventArgs e) { if (e.Contact != null && e.Message != null) { //Send a message to the contact in the chat session _chat.SendMessage(e.Contact.Name, e.Message).ContinueWith(sendMessage => { if (sendMessage.IsFaulted) { //display error } else { _chat.SaveMessage(e.Message); } }); } }