예제 #1
0
        public FrmUser(UserManager.User user, UserUI userUI)
        {
            InitializeComponent();

            this.pictureBox1.Image = Image.FromFile(FrmMain.theme.PicturePlus);
            //this.pictureBoxMenu.Image = Image.FromFile(FrmMain.theme.PictureMenu);
            this.pictureVoice.Image = Image.FromFile(FrmMain.theme.pictureVoice);
            panelLine.BackColor     = FrmMain.theme.LineColor;
            this.userUI             = userUI;
            this.Visible            = false;
            this.user       = user;
            this.id         = 0;
            LastInteracted  = 0;
            BoxChats        = new List <Panel>();
            files           = new List <FileInfo>();
            userINChatBoxes = new List <ucUserINChatBox>();
            InitUserForm();
            voicePanel = new ucVoicePanel(user, this);
            this.Controls.Add(voicePanel);
            this.SizeChanged        += UserForm_SizeChanged;
            this.panel2.SizeChanged += UserForm_SizeChanged;
            addpnInfo();
            ucInfoUser._LoadInfoUser(user, listfileShows);
            InitColor();
        }
예제 #2
0
        public void AddVoiceMessage(User _user, string path)
        {
            userUI.ucInterac.AddMessage(_user.Name + ": " + "Send a voice");

            Panel tempPanel = new Panel();

            tempPanel.AutoSize = true;
            tempPanel.Dock     = DockStyle.Top;

            ucUserINChatBox userINChatBox = new ucUserINChatBox(_user, this.user.Id);

            userINChatBox.DisableEdit();
            userINChatBox.DisableDelete();
            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);
        }
예제 #3
0
        public void AddItemInToListChat(User user, string IDMess, string str)
        {
            Panel tempPanel = new Panel();

            tempPanel.Dock     = DockStyle.Top;
            tempPanel.AutoSize = true;
            ucUserINChatBox UserInChatBox = new ucUserINChatBox(user, this.user.Id);

            if (user.Id != FrmMain.me.Id)
            {
                UserInChatBox.DisableEdit();
            }
            ucMessShow messShow = new ucMessShow(str, user, UserInChatBox);

            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);
            UserInChatBox.InitColor();
            messShow.ChangeTheme();

            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);
        }
예제 #4
0
        public void _LoadInfoUser(User user, List <ucFileShow> listfileShows)
        {
            this.user   = user;
            lbName.Text = "Name: " + user.Name;
            lbID.Text   = "#" + user.Id;
            Image image = Image.FromFile(user.AvatarPath);

            ptbavata.Image    = image;
            ptbavata.SizeMode = PictureBoxSizeMode.StretchImage;
            locationlabel(ref lbName, pnavata_name);
            locationlabel(ref lbID, pnavata_name);
            locationpanel(ref panel1, pnavata_name);

            _addfileinfilesent(listfileShows);
            if (user.IsFriend)
            {
                pnaddfriend.Visible    = false;
                pnRemoveFriend.Visible = true;
            }
            else
            {
                pnRemoveFriend.Visible = false;
                pnaddfriend.Visible    = true;
            }
        }
예제 #5
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);
        }