Ejemplo n.º 1
0
        /// <summary>
        /// 屏幕主菜单
        /// </summary>
        /// <param name="type"></param>
        private void SendAction(TeacherAction type)
        {
            switch (type)
            {
            case TeacherAction.menuClassNamed_Click:
                CallForm frm = new CallForm();
                frm.ShowDialog(this);
                break;

            case TeacherAction.menuExportSign_Click:
                ExportSign();
                break;

            case TeacherAction.menuGroupChat_Click:
                ChatToALL();
                break;

            case TeacherAction.menuTeamCreate_Click:
                TeamDiscuss formTeam = new TeamDiscuss(onlineInfo);
                formTeam.ShowDialog();
                break;

            case TeacherAction.menuViewTeam_Click:
                TeamView teamView = new TeamView();
                teamView.ShowDialog();
                break;

            case TeacherAction.menuSilence_Click:
                if (menuSilence.Text == "屏幕肃静")
                {
                    GlobalVariable.client.Send_Quiet();
                    menuSilence.Text = "解除屏幕肃静";
                }
                else
                {
                    GlobalVariable.client.Send_StopQuiet();
                    menuSilence.Text = "屏幕肃静";
                }
                break;

            case TeacherAction.menuRomoteControl_Click:
                //if (lvOnline.SelectedItems.Count <= 0)
                //{
                //    GlobalVariable.ShowWarnning("请先选择要控制的" + _clientTitle);
                //    return;
                //}
                //string username = lvOnline.SelectedItems[0].SubItems[2].Text;
                GetSelectStudentUserName();
                if (!string.IsNullOrWhiteSpace(actionStuUserName))
                {
                    if (menuRomoteControl.Text == "禁用键鼠")
                    {
                        GlobalVariable.client.Send_LockScreen(actionStuUserName);
                        menuRomoteControl.Text = "解锁";
                    }
                    else
                    {
                        GlobalVariable.client.Send_StopLockScreen(actionStuUserName);
                        menuRomoteControl.Text = "禁用键鼠";
                    }
                }
                break;

            case TeacherAction.menuScreenShare_Click:
                string text = menuScreenShare.Text;
                if (text == "屏幕广播")
                {
                    if (!isPush)
                    {
                        GlobalVariable.client.Send_ScreenInteract();
                        menuScreenShare.Text = "关闭广播";
                        isPush = true;
                    }
                    else
                    {
                        //  showTip();
                        return;
                    }
                }
                else
                {
                    GlobalVariable.client.StopScreenInteract();
                    GlobalVariable.client.Send_StopScreenInteract();
                    menuScreenShare.Text = "屏幕广播";
                    isPush = false;
                }
                break;

            case TeacherAction.menuStudentShow_Click:
                string menuStudentText = menuStudentShow.Text;
                if (!isStudentShowing)
                {
                    GetSelectStudentUserName();
                    if (!string.IsNullOrWhiteSpace(actionStuUserName))
                    {
                        GlobalVariable.client.Send_CallStudentShow(actionStuUserName);
                        menuStudentShow.Text = "关闭演示";
                        isStudentShowing     = true;
                    }
                }
                else
                {
                    if (!string.IsNullOrWhiteSpace(actionStuUserName))
                    {
                        GlobalVariable.client.Send_StopStudentShow(actionStuUserName);
                        actionStuUserName    = null;
                        menuStudentShow.Text = _clientTitle + "演示";
                        isStudentShowing     = false;
                    }
                }
                break;

            case TeacherAction.menuVideoLive_Click:
                string menuVideoLiveText = menuVideoLive.Text;
                if (menuVideoLiveText == "视频直播")
                {
                    if (!isPush)
                    {
                        GlobalVariable.client.Send_VideoInteract();
                        menuVideoLive.Text = "关闭直播";
                        isPush             = true;
                    }
                    else
                    {
                        //  showTip();
                        return;
                    }
                }
                else
                {
                    GlobalVariable.client.StopScreenInteract();
                    GlobalVariable.client.Send_StopScreenInteract();
                    menuVideoLive.Text = "视频直播";
                    isPush             = false;
                }
                break;

            case TeacherAction.menuFileShare_Click:
                ChatToALL();
                chatForm.UploadFileToALL();     // 暂时屏蔽
                break;

            case TeacherAction.menuFileShare2_Click:

                break;

            case TeacherAction.menuAccount_Click:
                break;

            case TeacherAction.menuVideoRecord_Click:

                if (this.menuVideoRecord.Text == "屏幕录制")
                {
                    GlobalVariable.BeginRecordVideo();
                    this.menuVideoRecord.Image = Resources.录制;
                    GlobalVariable.ShowNotifyMessage("正在屏幕录制中...", -1);
                    this.menuVideoRecord.Text = "停止录制";
                }
                else
                {
                    GlobalVariable.EndRecordVideo();
                    GlobalVariable.ShowNotifyMessage("录制完成,视频文件在程序目录的VideoRecord中", -1);
                    this.menuVideoRecord.Image = Resources.未录制;
                    this.menuVideoRecord.Text  = "屏幕录制";
                }
                break;

            default:
                break;
            }
        }