public void AddItemToListChat(User user, string IDMess, string str) { Panel tempPanel = new Panel(); tempPanel.Dock = DockStyle.Top; tempPanel.AutoSize = true; ucUserINChatBox UserInChatBox = new ucUserINChatBox(user, group.ID); ucMessShow messShow = new ucMessShow(str, user, UserInChatBox); if (user.Id != FrmMain.me.Id) { UserInChatBox.DisableEdit(); } messShow.Dock = DockStyle.Top; UserInChatBox.Dock = DockStyle.Top; UserInChatBox._AddMessControl(messShow); tempPanel.Controls.Add(UserInChatBox); this.panelListChat.Controls.Add(tempPanel); this.panelListChat.Controls.Add(tempPanel); if (IDMess == "-1") { FrmMain.listMessAwaitID.Add(UserInChatBox); // Thêm vào hàng đợi ID ti nhan từ server gửi xuống } else { UserInChatBox.ID = IDMess; } userINChatBoxes.Add(UserInChatBox); }
public void AddFileToListChat(User user, string IDMess, string tempName) { GroupUI.ucGroupInteract.AddMessage(user.Name + ": " + "Send a file"); Panel tempPanel = new Panel(); tempPanel.AutoSize = true; tempPanel.Dock = DockStyle.Top; ucUserINChatBox UserInChatBox = new ucUserINChatBox(user, group.ID); ucFileShow fileShow = new ucFileShow(user, IDMess, tempName, UserInChatBox); UserInChatBox.DisableEdit(); //if (user == FrmMain.me) // fileShow._DisableButDownLoad(); fileShow.Dock = DockStyle.Top; UserInChatBox.Dock = DockStyle.Top; UserInChatBox._AddFileControl(fileShow); tempPanel.Controls.Add(UserInChatBox); this.panelListChat.Controls.Add(tempPanel); if (IDMess == "-1") { FrmMain.listFileAwaitID.Add(UserInChatBox); // Thêm vào hàng đợi ID ti nhan từ server gửi xuống } else { UserInChatBox.ID = IDMess; } listfileShows.Add(fileShow); userINChatBoxes.Add(UserInChatBox); }
public void AddVoiceMessage(User _user, string path) { GroupUI.ucGroupInteract.AddMessage(_user.Name + ": " + "Send a voice"); Panel tempPanel = new Panel(); tempPanel.AutoSize = true; tempPanel.Dock = DockStyle.Top; ucUserINChatBox userINChatBox = new ucUserINChatBox(_user, group.ID); userINChatBox.DisableDelete(); userINChatBox.DisableEdit(); ucVoiceMessage voiceMessage = new ucVoiceMessage(path, userINChatBox); voiceMessage.Path = path; voiceMessage.Dock = DockStyle.Top; userINChatBox.Dock = DockStyle.Top; userINChatBox._AddVoiceMessage(voiceMessage); tempPanel.Controls.Add(userINChatBox); this.panelListChat.Controls.Add(tempPanel); userINChatBox.InitColor(); // voiceMessage.InitColor(); userINChatBoxes.Add(userINChatBox); }
public void AddFileToListChat(User _user, string tempID, string tempName) { userUI.ucInterac.AddMessage(user.Name + ": " + "Send a file"); Panel tempPanel = new Panel(); tempPanel.AutoSize = true; tempPanel.Dock = DockStyle.Top; ucUserINChatBox UserInChatBox = new ucUserINChatBox(_user, this.user.Id); UserInChatBox.DisableEdit(); ucFileShow fileshow = new ucFileShow(_user, tempID, tempName, UserInChatBox); //if (_user == Form1.me) fileshow._DisableButDownLoad(); fileshow.Dock = DockStyle.Top; UserInChatBox.Dock = DockStyle.Top; UserInChatBox._AddFileControl(fileshow); tempPanel.Controls.Add(UserInChatBox); this.panelListChat.Controls.Add(tempPanel); UserInChatBox.InitColor(); fileshow.InitColor(); if (tempID == "-1") { FrmMain.listFileAwaitID.Add(UserInChatBox); // Thêm vào hàng đợi ID file từ server gửi xuống } else { UserInChatBox.ID = tempID; } listfileShows.Add(fileshow); userINChatBoxes.Add(UserInChatBox); }