private void SaveFriendDict() { foreach (var file in IOTool.GetFiles(GetContactsDirPath())) { file.Delete(); } foreach (var userID in _friendDict.Keys) { string filePath = GetContactsDirPath() + "/" + userID; IOTool.SerializeToFile <UserItem>(filePath, _friendDict[userID]); } }
private void SaveLogDict() { foreach (var file in IOTool.GetFiles(GetChatDirPath())) { file.Delete(); } foreach (var userID in _chatLogDict.Keys) { string filePath = GetChatDirPath() + "/" + userID; IOTool.SerializeToFile <ChatLog>(filePath, _chatLogDict[userID]); } }
private void SaveGroupDict() { foreach (var file in IOTool.GetFiles(GetGroupDirPath())) { file.Delete(); } foreach (var groupID in _groupDict.Keys) { string filePath = GetGroupDirPath() + "/" + groupID; IOTool.SerializeToFile <GroupItem>(filePath, _groupDict[groupID]); } }