Exemplo n.º 1
0
        /// <summary>
        /// Callback called when the search on a phone number or an email for a contact has a match
        /// </summary>
        private void cm_ContactFound(object sender, ContactFoundEventArgs e)
        {
            string address     = e.PhoneNumber;
            string displayName = address;

            if (e.ContactFound != null)
            {
                displayName = e.ContactFound.DisplayName;
                Conversation conv = null;
                foreach (var conversation in _conversations)
                {
                    if (conversation.SipAddress.Equals(e.Request))
                    {
                        conv = conversation;
                        break;
                    }
                }
                if (conv != null)
                {
                    _conversations.Remove(conv);
                    conv.DisplayedName = displayName;
                    _conversations.Add(conv);
                }

                _sortedConversations = new ObservableCollection <Conversation>();
                foreach (var i in _conversations.OrderByDescending(g => g.Messages.Last().Time).ToList())
                {
                    _sortedConversations.Add(i);
                }
                ((ChatsModel)ViewModel).Conversations = _sortedConversations;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Callback called when the search on a phone number or an email for a contact has a match
        /// </summary>
        private void cm_ContactFound(object sender, ContactFoundEventArgs e)
        {
            if (e.ContactFound != null)
            {
                ContactName.Text = e.ContactFound.DisplayName;
                ContactManager.Instance.TempContact = e.ContactFound;
                ContactName.Tap += ContactName_Tap;

                ContactName.Visibility = Visibility.Visible;
                NewChat.Visibility     = Visibility.Collapsed;
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// Callback called when the search on a phone number for a contact has a match
 /// </summary>
 private void cm_ContactFound(object sender, ContactFoundEventArgs e)
 {
     if (e.ContactFound != null)
     {
         Contact.Text = e.ContactFound.DisplayName;
         if (e.PhoneLabel != null)
         {
             Number.Text = e.PhoneLabel + " : " + e.PhoneNumber;
         }
         else
         {
             Number.Text = e.PhoneNumber;
         }
     }
 }