Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }