Esempio n. 1
0
 internal bool DeleteContact(VATRPContact contact)
 {
     if (contact == null)
     {
         return(false);
     }
     return(this.DeleteContact(new ContactID(contact)));
 }
Esempio n. 2
0
 public VATRPChat(VATRPContact contact, string dialogId, bool isRtt) : base(contact, isRtt, dialogId)
 {
     this._typing_text       = string.Empty;
     this._is_messagesLoaded = true;
     this._lastMessage       = string.Empty;
     this._messageFont       = "Segoe UI";
     if (contact != null)
     {
         this.Messages           = new ObservableCollection <VATRPChatMessage>();
         this._temp_messages     = new ObservableCollection <VATRPChatMessage>();
         this.Contacts           = new ObservableCollection <VATRPContact>();
         this._is_messagesLoaded = true;
         this.Contacts.Add(contact);
         base.ID   = contact.ID;
         this.Name = contact.Fullname;
         this.ShowNotInCL_Notification = false;
         this.IsEmptychat = false;
     }
 }
Esempio n. 3
0
        private VATRPContact FindContact(VATRPContact _ce)
        {
            VATRPContact contact = null;

            if (_ce != null)
            {
                lock (this.Contacts)
                {
                    for (int i = 0; i < this.Contacts.Count; i++)
                    {
                        if (this.Contacts[i].ID == _ce.ID)
                        {
                            return(this.Contacts[i]);
                        }
                    }
                }
            }
            return(contact);
        }
Esempio n. 4
0
        internal bool AddContact(VATRPContact contact)
        {
            //****************************************************************************************************
            // If contact is alredy logged in then add contact to chat room
            //****************************************************************************************************
            if (contact == null)
            {
                return(false);
            }

            VATRPContact existingContact = this.FindContact(contact);

            if (existingContact != null)
            {
                existingContact.Status = contact.Status;
                return(false);
            }

            lock (this.Contacts)
            {
                this.Contacts.Add(contact);
            }
            return(true);
        }