Esempio n. 1
0
        private void ContactRemoved(object sender, ContactRemovedEventArgs e)
        {
            //*************************************************************************************************************************************************
            // When Contact removed from Contact list.
            //*************************************************************************************************************************************************
            if (ServiceManager.Instance.Dispatcher.Thread != System.Threading.Thread.CurrentThread)
            {
                ServiceManager.Instance.Dispatcher.BeginInvoke((Action)(() => this.ContactRemoved(sender, e)));
                return;
            }

            RemoveContactModel(e.contactId);
        }
 async void contactPickerUI_ContactRemoved(ContactPickerUI sender, ContactRemovedEventArgs args)
 {
     // The event handler may be invoked on a background thread, so use the Dispatcher to run the UI-related code on the UI thread.
     string removedId = args.Id;
     await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
     {
         foreach (SampleContact contact in ContactList.SelectedItems)
         {
             if (contact.Id == removedId)
             {
                 ContactList.SelectedItems.Remove(contact);
                 OutputText.Text += "\n" + contact.Name + " was removed from the basket";
                 break;
             }
         }
     });
 }
Esempio n. 3
0
        private void OnChatContactRemoved(object sender, ContactRemovedEventArgs e)
        {
            //*************************************************************************************************************************************************
            // When Contact is removed from Chat.
            //*************************************************************************************************************************************************
            if (ServiceManager.Instance.Dispatcher.Thread != Thread.CurrentThread)
            {
                ServiceManager.Instance.Dispatcher.BeginInvoke(DispatcherPriority.Normal,
                                                               new EventHandler <ContactRemovedEventArgs>(OnChatContactRemoved), sender, new object[] { e });
                return;
            }

            var contactVM = FindContactViewModel(e.contactId);

            if (contactVM != null)
            {
                this.Contacts.Remove(contactVM);
                OnPropertyChanged("Contacts");
            }
        }
        private void OnContactRemoved(object sender, ContactRemovedEventArgs e)
        {
            //*************************************************************************************************************************************************
            // When Contact removed from Contact list.
            //*************************************************************************************************************************************************
            if (ServiceManager.Instance.Dispatcher.Thread != System.Threading.Thread.CurrentThread)
            {
                ServiceManager.Instance.Dispatcher.BeginInvoke((Action)(() => this.OnContactRemoved(sender, e)));
                return;
            }

            lock (this.Calls)
            {
                foreach (var call in Calls)
                {
                    if (call.CallEvent.Contact != null && call.CallEvent.Contact.ID == e.contactId.ID)
                    {
                        call.UpdateContact(null);
                        call.AllowAddContact = true;
                    }
                }
            }
            CallsListView.Refresh();
        }
Esempio n. 5
0
 private void OnContactRemoved(object sender, ContactRemovedEventArgs e)
 {
     RemoveContact(e.contactId);
 }
 private void OnContactRemoved(object sender, ContactRemovedEventArgs e)
 {
     RemoveContact(e.contactId);
 }
        private void OnChatContactRemoved(object sender, ContactRemovedEventArgs e)
        {
            if (ServiceManager.Instance.Dispatcher.Thread != Thread.CurrentThread)
            {
                ServiceManager.Instance.Dispatcher.BeginInvoke(DispatcherPriority.Normal,
                    new EventHandler<ContactRemovedEventArgs>(OnChatContactRemoved), sender, new object[] { e });
                return;
            }

            var contactVM = FindContactViewModel(e.contactId);
            if (contactVM != null)
            {
                this.Contacts.Remove(contactVM);
                OnPropertyChanged("Contacts");
            }
        }
 public void OnContactRemoved(object sender, ContactRemovedEventArgs e)
 {
     VATRPContact contact = this._contactSvc.FindContact(e.contactId);
     if (contact != null)
     {
         VATRPChat chat = FindChat(contact);
         if (chat != null)
         {
             if (ConversationClosed != null)
                 ConversationClosed(this, new ConversationEventArgs(chat));
             RemoveChat(chat);
         }
         Contacts.Remove(contact);
         if (ContactRemoved != null)
             ContactRemoved(this, new ContactRemovedEventArgs(new ContactID(contact), true));
     }
 }
        private void ContactRemoved(object sender, ContactRemovedEventArgs e)
        {
            if (ServiceManager.Instance.Dispatcher.Thread != System.Threading.Thread.CurrentThread)
            {
                ServiceManager.Instance.Dispatcher.BeginInvoke((Action)(() => this.ContactRemoved(sender, e)));
                return;
            }

            RemoveContactModel(e.contactId);
        }
Esempio n. 10
0
 /// <summary>
 /// Invoked when user removes one of the items from the Picker basket
 /// </summary>
 /// <param name="sender">The FileOpenPickerUI instance used to contain the available files.</param>
 /// <param name="e">Event data that describes the file removed.</param>
 private async void HandleContactPickerUIContactRemoved(ContactPickerUI sender, ContactRemovedEventArgs e)
 {
     await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
     {
         // Synchronize the select items in the UI lists to remove hte item that was removed from the picker's 'basket'
         var removedSelectedGridItem = ContactGridView.SelectedItems.Cast <Contact>().FirstOrDefault(x => x.Id == e.Id);
         if (removedSelectedGridItem != null)
         {
             ContactGridView.SelectedItems.Remove(removedSelectedGridItem);
         }
     });
 }
        private void OnContactRemoved(object sender, ContactRemovedEventArgs e)
        {
            if (ServiceManager.Instance.Dispatcher.Thread != System.Threading.Thread.CurrentThread)
            {
                ServiceManager.Instance.Dispatcher.BeginInvoke((Action)(() => this.OnContactRemoved(sender, e)));
                return;
            }

            lock (this.Calls)
            {
                foreach (var call in Calls)
                {
                    if (call.CallEvent.Contact != null && call.CallEvent.Contact.ID == e.contactId.ID)
                    {
                        call.UpdateContact(null);
                        call.AllowAddContact = true;
                    }
                }
            }
            CallsListView.Refresh();
        }