Beispiel #1
0
        /// <summary>
        /// 工具栏点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void toolBar_ButtonClick(object sender, ToolBarButtonClickEventArgs e)
        {
            if (e.Button == toolBarButtonPushScreen)
            {
                if (toolBarButtonPushScreen.Text == "推送桌面")
                {
                    SendControl("PushScreen");
                    pushScreen.Start();

                    toolBarButtonPushScreen.Text = "停止推送";
                }
                else
                {
                    toolBarButtonPushScreen.Text = "推送桌面";
                    SendControl("PushScreen Closed");
                    pushScreen.Stop();
                }
            }
            else if (controlConnected)
            {
                if (e.Button == toolBarButtonRemote)
                {
                    ScreenForm screenForm = new ScreenForm();
                    screenForm.ShowDialog();
                }
                else if (e.Button == toolBarButtonVideo)
                {
                    VideoForm videoForm = new VideoForm();
                    videoForm.ShowDialog();
                }
                else if (e.Button == toolBarButtonCommand)
                {
                    CommandForm commandForm = new CommandForm();
                    commandForm.ShowDialog();
                }
                else if (e.Button == toolBarButtonFileManage)
                {
                    if (!Clients.isThread_FileManageStarted)
                    {
                        Clients.thread_FileMange = new Thread(FileManagementConnection);
                        Clients.thread_FileMange.Start();
                        Clients.isThread_FileManageStarted = true;
                    }
                    tabControl.SelectedTab = this.tabPageFileManage;
                }
                else if (e.Button == toolBarButtonChat)
                {
                    ChatForm chatForm = new ChatForm();
                    chatForm.ShowDialog();
                }
            }
            else
            {
                MessageBox.Show("请先连接远程主机");
            }
        }
        /// <summary>
        /// 工具栏点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void toolBar_ButtonClick(object sender, ToolBarButtonClickEventArgs e)
        {
            if (e.Button == toolBarButtonPushScreen)
            {
                if (toolBarButtonPushScreen.Text == "推送桌面")
                {
                    SendControl("PushScreen");
                    pushScreen.Start();

                    toolBarButtonPushScreen.Text = "停止推送";
                }
                else
                {
                    toolBarButtonPushScreen.Text = "推送桌面";
                    SendControl("PushScreen Closed");
                    pushScreen.Stop();
                }

            }
            else if (controlConnected)
            {
                if (e.Button == toolBarButtonRemote)
                {
                    ScreenForm screenForm = new ScreenForm();
                    screenForm.ShowDialog();

                }
                else if (e.Button == toolBarButtonVideo)
                {
                    VideoForm videoForm = new VideoForm();
                    videoForm.ShowDialog();
                }
                else if (e.Button == toolBarButtonCommand)
                {
                    CommandForm commandForm = new CommandForm();
                    commandForm.ShowDialog();
                }
                else if (e.Button == toolBarButtonFileManage)
                {
                    if (!Clients.isThread_FileManageStarted)
                    {
                        Clients.thread_FileMange = new Thread(FileManagementConnection);
                        Clients.thread_FileMange.Start();
                        Clients.isThread_FileManageStarted = true;
                    }
                    tabControl.SelectedTab = this.tabPageFileManage;
                }
                else if (e.Button == toolBarButtonChat)
                {
                    ChatForm chatForm = new ChatForm();
                    chatForm.ShowDialog();
                }
            }
            else
            {
                MessageBox.Show("请先连接远程主机");
            }
        }