public static ChatGroupList GetAllGroupList()
 {
     if (allGroup == null)
     {
         allGroup = new ChatGroupList();
     }
     return(allGroup);
 }
        public ChatGroupList Copy()
        {
            ChatGroupList copy = new ChatGroupList();

            foreach (var group in GroupList)
            {
                copy.GroupList.Add(group.Copy());
            }
            return(copy);
        }
        public ChatGroupList GetGroupByUserId(string id)
        {
            ChatGroupList chatGroupList = new ChatGroupList();

            foreach (var group in GroupList)
            {
                if (group.HasId(id))
                {
                    chatGroupList.AddNewGroup(group);
                }
            }
            return(chatGroupList);
        }
        public ChatGroupList GetGroupByCreatorId(string id)
        {
            ChatGroupList chatGroupList = new ChatGroupList();

            foreach (var group in GroupList)
            {
                if (group.CreatorId == id)
                {
                    chatGroupList.AddNewGroup(group);
                }
            }
            return(chatGroupList);
        }