//public static void SaveTeamInfoToFile() //{ // var request = _teamList.ConvertToTeacherTeam(LoginUserInfo.UserName, LoginUserInfo.DisplayName); // CreateTeamXMLFile(request); //} private static void CreateTeamXMLFile(TeacherTeam info) { //var info = new TeacherTeam(); //info.DisplayName = LoginUserInfo.DisplayName; //info.UserName = LoginUserInfo.UserName; //info.TeamInfos = new List<TeamInfo>(); //foreach (ChatStore chat in teamChatList) //{ // TeamInfo team = new TeamInfo(); // team.groupid = chat.ChatUserName; // team.groupname = chat.ChatDisplayName; // team.groupuserList = chat.TeamMembers.ToList(); // info.TeamInfos.Add(team); //} string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "TeamXML"); if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } string fileName = Path.Combine(path, "群组" + info.UserName + ".xml"); if (File.Exists(fileName)) { File.Delete(fileName); } XmlHelper.SerializerToFile(info, fileName); }
public static void LoadTeamList(TeacherTeam teamList) { IsTeamChatChanged = true; // var list = GetTeamChatList(); foreach (TeamInfo teamInfo in teamList.TeamInfos) { var team = _teamList.FirstOrDefault(d => d.TeamId == teamInfo.groupid); if (team != null) { team.TeamName = teamInfo.groupname; team.UpdateTeamMembers(teamInfo.groupuserList); } else { Team info = teamInfo.ConvertToTeam(); _teamList.Add(info); //ChatStore info = new ChatStore(); //info.ChatDisplayName = teamInfo.groupname; //info.ChatStartTime = DateTime.Now; //info.ChatType = ChatType.TeamChat; //info.ChatUserName = teamInfo.groupid; //info.UserType = ClientRole.Teacher; //info.MessageList = new List<ChatMessage>(); //info.TeamMembers = teamInfo.groupuserList; //ChatList.Add(info); } } }
private static void CreateTeamXMLFile(TeacherTeam info) { string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "TeamXML"); if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } string fileName = Path.Combine(path, "群组" + info.UserName + ".xml"); if (File.Exists(fileName)) { File.Delete(fileName); } XmlHelper.SerializerToFile(info, fileName); }
/// <summary> /// 加载群组列表 /// </summary> /// <param name="teachTeam"></param> public static void LoadTeamList(TeacherTeam teachTeam) { IsTeamChatChanged = true; // var list = GetTeamChatList(); foreach (TeamInfo teamInfo in teachTeam.TeamInfos) { var team = _teamList.FirstOrDefault(d => d.TeamId == teamInfo.groupid); if (team != null) { team.TeamName = teamInfo.groupname; team.UpdateTeamMembers(teamInfo.groupuserList); } else { Team info = teamInfo.ConvertToTeam(); _teamList.Add(info); } } }
/// <summary> /// 创建群组 /// </summary> /// <param name="request"></param> public void Send_CreateTeam(TeacherTeam request) { SendMessage(request, CommandType.CreateTeam); }