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 _addfileinfilesent(List <ucFileShow> listfileShows) { pnaddfile.Controls.Clear(); if (listfileShows.Count > 0) { for (int i = 0; i < listfileShows.Count; i++) { ucFileShow tam = new ucFileShow(listfileShows[i].user, listfileShows[i]._FileId, listfileShows[i]._FileName, listfileShows[i].ucParent); tam.Dock = DockStyle.Top; if (tam._FileName != "Deleted file") { pnaddfile.Controls.Add(tam); } } } }
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); }
public void _AddFileControl(ucFileShow filecontrol) { isFile = true; this.panelAddMessage.Controls.Add(filecontrol); this.ucfileshow = filecontrol; }