private void LoadFriendDict()
 {
     ClearFriendDict();
     if (_friendDict.Count == 0 && IOTool.IsDirExist(GetContactsDirPath()))
     {
         foreach (var file in IOTool.GetFiles(GetContactsDirPath()))
         {
             UserItem userItem = IOTool.DeserializeFromFile <UserItem>(file.FullName);
             if (userItem != null)
             {
                 _friendDict[userItem.userId] = userItem;
             }
         }
     }
 }
Example #2
0
 private void LoadLogDict()
 {
     ClearLogDict();
     if (IOTool.IsDirExist(GetChatDirPath()))
     {
         foreach (var file in IOTool.GetFiles(GetChatDirPath()))
         {
             ChatLog chatLog = IOTool.DeserializeFromFile <ChatLog>(file.FullName);
             if (chatLog != null)
             {
                 _chatLogDict[chatLog.chatID] = chatLog;
             }
         }
     }
 }
 private void LoadGroupDict()
 {
     ClearGroupDict();
     if (_groupDict.Count == 0 && IOTool.IsDirExist(GetGroupDirPath()))
     {
         foreach (var file in IOTool.GetFiles(GetGroupDirPath()))
         {
             GroupItem groupItem = IOTool.DeserializeFromFile <GroupItem>(file.FullName);
             if (groupItem != null)
             {
                 _groupDict[groupItem.groupId] = groupItem;
             }
         }
     }
 }