protected abstract List <TUser> DoGetAllContacts(); //好友,包括组友


        #region Ctor
        public virtual void Initialize(string curUserID, string persistencePath, string _companyGroupID, IAgileLogger _logger)
        {
            this.GroupChanged        += delegate { };
            this.FriendInfoChanged   += delegate { };
            this.FriendStatusChanged += delegate { };
            this.FriendRemoved       += delegate { };

            this.FriendRTDataRefreshCompleted += new CbGeneric(GlobalUserCache_FriendRTDataRefreshCompleted);

            this.companyGroupID = _companyGroupID;
            this.logger         = _logger;

            //自己的信息始终加载最新的
            this.currentUser = this.DoGetUser(curUserID);
            this.userManager.Add(this.currentUser.ID, this.currentUser);

            this.persistenceFilePath        = persistencePath;
            this.originUserLocalPersistence = UserLocalPersistence <TUser, TGroup> .Load(this.persistenceFilePath);//返回null,表示该登录帐号还没有任何缓存

            if (this.originUserLocalPersistence != null && this.originUserLocalPersistence.FriendList != null)
            {
                foreach (TUser user in this.originUserLocalPersistence.FriendList)
                {
                    if (user.ID == null)
                    {
                        continue;
                    }
                    if (user.ID != this.currentUser.ID)
                    {
                        user.UserStatus = UserStatus.OffLine;
                        this.userManager.Add(user.ID, user);
                    }
                }

                foreach (TGroup group in this.originUserLocalPersistence.GroupList)
                {
                    if (this.currentUser.GroupList.Contains(group.ID))
                    {
                        this.groupManager.Add(group.ID, group);
                    }

                    #if Org
                    if (this.currentUser.IsInOrg)
                    {
                        if (this.IsCompanyGroupID(group.ID))
                        {
                            this.groupManager.Add(group.ID, group);
                        }
                    }
                    #endif
                }
            }
        }
        public void SaveUserLocalCache(List <string> recentList) //recentID的列表,recentID以“G_”或“U_”开头,以区分用户或组。
        {
            if (recentList == null)
            {
                if (this.originUserLocalPersistence != null)
                {
                    recentList = this.originUserLocalPersistence.RecentList;
                }
            }

            UserLocalPersistence <TUser, TGroup> cache = new UserLocalPersistence <TUser, TGroup>(this.userManager.GetAllReadonly(), this.groupManager.GetAll(), recentList);

            cache.Save(this.persistenceFilePath);
        }