Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
 public ucVoiceMessage(string path, ucUserINChatBox userINChatBox)
 {
     InitializeComponent();
     this.Path                  = path;
     this.userINChatBox         = userINChatBox;
     this.picturePlay.Image     = Image.FromFile(FrmMain.theme.picturePlay02);
     this.picturePause.Image    = Image.FromFile(FrmMain.theme.picturePause);
     this.picturePlayBack.Image = Image.FromFile(FrmMain.theme.pictureStop);
     _InitColor();
 }
Exemplo n.º 5
0
        public ucFileShow(User user, string fileId, string fileName, ucUserINChatBox ucUserINChatBox)
        {
            InitializeComponent();
            this.ucParent = ucUserINChatBox;
            this.user     = user;
            this.fileId   = fileId;
            this.fileName = fileName;

            this.label1.Text = fileName;
        }
Exemplo n.º 6
0
 public ucMessShow(string mess, User user, ucUserINChatBox ucUserINChatBox)
 {
     InitializeComponent();
     this.user        = user;
     this.label1.Text = mess;
     this.ScaleLabel();
     this.ucParent         = ucUserINChatBox;
     this.label1.ForeColor = FrmMain.theme.TextColor;
     this.BackColor        = Color.Transparent;
 }
Exemplo n.º 7
0
 public ucEditMessage(ucUserINChatBox ucUserINChatBox, ucMessShow ucMessShow)
 {
     InitializeComponent();
     this.pnparent           = ucUserINChatBox;
     this.ucmessshow         = ucMessShow;
     this.lbCancel.ForeColor = FrmMain.theme.TxtForeColor;
     this.lbSave.ForeColor   = FrmMain.theme.TxtForeColor;
     this.textBox1.BackColor = FrmMain.theme.BackColor;
     this.textBox1.ForeColor = FrmMain.theme.TxtForeColor;
     this.textBox1.Text      = ucMessShow.GetText();
     this.Visible            = true;
 }
Exemplo n.º 8
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);
        }