コード例 #1
0
 public void Terminate()
 {
     Messages.Clear();
     messageUIDS.Clear();
     Conversations.Clear();
     ConversationByCID.Clear();
     visibilityByConversationID.Clear();
     ConversationFilter = string.Empty;
 }
コード例 #2
0
        public void GetAllConversations()
        {
            App.Current.Dispatcher.Invoke((Action) delegate

            {
                Conversations.Clear();
                ConversationByCID.Clear();
                CurrentConversation = null;
            });


            WebSocket.Instance.GetAllConversations();
        }
コード例 #3
0
        public void ReceivedUserConversations(List <Conversation> conversations)
        {
            App.Current.Dispatcher.Invoke((Action) delegate

            {
                CurrentConversation = null;
                ConversationFilter  = string.Empty;
                Conversations.Clear();
                ConversationByCID.Clear();

                foreach (var conversation in conversations)
                {
                    AddConversationToView(conversation);
                }
            });
        }
コード例 #4
0
        public void OnReceivedAllConversations(List <Conversation> conversations)
        {
            App.Current.Dispatcher.BeginInvoke((Action) delegate

            {
                CurrentConversation = null;
                Conversations.Clear();
                ConversationByCID.Clear();

                var filteredConverstions = conversations.Where(w => w.ConvName.ToLower().Contains(ConversationFilter.ToLower()));

                foreach (var conversation in filteredConverstions)
                {
                    AddConversationToView(conversation);
                }
            });
        }
コード例 #5
0
        private void AddConversationToView(Conversation conversation)
        {
            if (ConversationByCID.ContainsKey(conversation.CID))
            {
                ConversationByCID[conversation.CID].UIDS = conversation.UIDS;
                if (conversation.Equals(CurrentConversation))
                {
                    CurrentConversation = ConversationByCID[conversation.CID];
                }
            }

            else
            {
                ConversationByCID.Add(conversation.CID, conversation);

                App.Current.Dispatcher.Invoke((Action) delegate

                {
                    Conversations.Add(conversation);
                });
            }
        }