Ejemplo n.º 1
0
        //清空输入框
        private void btnCancel_Click(object sender, RoutedEventArgs e)
        {
            PerMsg mp   = new PerMsg("wang", "ceshi1");
            Chat   chat = chats.Where(p => p.SenderName.Equals("wang")).FirstOrDefault();

            chat.Msgs.Add(mp);
            chat.WaitReadNum       += 1;
            model.AllChatWaitReads += 1;
        }
Ejemplo n.º 2
0
        // this method will search through the List of Chat objects
        // and return the results containing the search key
        // we are searching in both messages and sender fields
        public static List <Chat> SearchChat(string searchKey)
        {
            searchKey = searchKey.ToLower();

            var result = ChatList.Where(x => x.Fields.Message.ToLower().Contains(searchKey) ||
                                        x.Fields.Username.ToLower().Contains(searchKey)).Select(y => y).ToList();

            return(result);
        }
Ejemplo n.º 3
0
 private void btnChatDelOne_Click(object sender, RoutedEventArgs e)
 {
     chats.Remove(chats.Where(p => p.SenderId.Equals("8888")).FirstOrDefault());
 }
Ejemplo n.º 4
0
 public WeChatUser[] SearchRoomChat(string searchText)
 {
     return(ChatList.Where(p => p.IsRoomContact()).Where(p => p.ShowName?.Contains(searchText) == true || p.ShowPinYin?.Contains(searchText) == true).ToArray());
 }