Exemplo n.º 1
0
        private void delVideoRequest(String otherNeck, String otherIP, int otherSendPort, int otherRecvPort)
        {
            DialogResult dr =
                MessageBox.Show("来自:" + otherNeck, "视频聊天请求", MessageBoxButtons.YesNo);

            if (dr == DialogResult.Yes)
            {
                // 确认私聊窗口
                PrivateForm pf = null;
                if (privateChatForms.Keys.Contains(otherNeck))
                {
                    pf = privateChatForms[otherNeck];
                }
                else
                {
                    pf = createPrivateForm(otherNeck);
                }

                // 切入视频聊天模式
                pf.ToggleVideoMove(true);

                // ChaitClient - 接受视频聊天
                ChaitClient.Instance.AcceptVideo(otherNeck, IPAddress.Parse(otherIP), otherSendPort, otherRecvPort, pf.OnFrameReceivedHandler);
            }
            else
            {
                ChaitClient.Instance.RefuseVideo(otherNeck);
            }
        }
Exemplo n.º 2
0
        private PrivateForm createPrivateForm(String neckname)
        {
            PrivateForm pf = new PrivateForm();

            pf.Text = neckname;
            privateChatForms.Add(neckname, pf);
            pf.Show();
            return(pf);
        }
Exemplo n.º 3
0
        private void delVideoAccepted(String otherNeck, String otherIP, int otherSendPort, int otherRecvPort)
        {
            // 获取私聊窗口
            PrivateForm pf = null;

            if (privateChatForms.Keys.Contains(otherNeck))
            {
                pf = privateChatForms[otherNeck];
            }
            else
            {
                pf = createPrivateForm(otherNeck);
            }

            // 切入视频模式
            pf.ToggleVideoMove(true);

            // ChaitClient - 开始视频
            ChaitClient.Instance.RequesterStartVideo(otherNeck, IPAddress.Parse(otherIP), otherSendPort, otherRecvPort);
        }
Exemplo n.º 4
0
        private void lsb_friends_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (lsb_friends.SelectedItem == null ||
                lsb_friends.SelectedItem.ToString() == null)
            {
                return;
            }
            String chatNeck = lsb_friends.SelectedItem.ToString();

            if (privateChatForms.Keys.Contains(chatNeck))
            {
                privateChatForms[chatNeck].BringToFront();
            }
            else
            {
                PrivateForm pf = new PrivateForm();
                pf.Text = chatNeck;
                privateChatForms.Add(chatNeck, pf);
                pf.Show();
            }
        }