private void ShowHidePTZTool() { bool bShow = true; if (_ptzTool != null) { _ptzTool.Close(); bShow = false; } else { _ptzTool = new PTZTool {Owner = this}; _ptzTool.Show(this); _ptzTool.Closing += PTZToolClosing; _ptzTool.CameraControl = null; for (int i = 0; i < _pnlCameras.Controls.Count; i++) { Control c = _pnlCameras.Controls[i]; if (c.Focused && c is CameraWindow) { _ptzTool.CameraControl = (CameraWindow) c; break; } } } pTZControllerToolStripMenuItem.Checked = menuItem18.Checked = pTZControllerToolStripMenuItem1.Checked = bShow; Conf.ShowPTZController = bShow; }
private void PTZToolClosing(object sender, CancelEventArgs e) { pTZControllerToolStripMenuItem.Checked = menuItem18.Checked = pTZControllerToolStripMenuItem1.Checked = false; Conf.ShowPTZController = false; _ptzTool = null; }