/// <summary> /// 打开视频窗口 /// </summary> /// <param name="request"></param> private void procVideo_OpenWindow(WSRequest request) { var req = JsonConvert.DeserializeObject <WSVideoRequest_OpenWindow>(request.Params.ToString()); FrmVideo frmVideo = this.getVideoFormByID(req.PanelID); int screenid = req.ScreenID ?? 0; if (screenid > Screen.AllScreens.Length) { screenid = 0; } var screen = Screen.AllScreens[screenid]; frmVideo.Width = req.Width ?? frmVideo.Width; frmVideo.Height = req.Height ?? frmVideo.Height; frmVideo.Location = new System.Drawing.Point(req.LocationX ?? frmVideo.Location.X, req.LocationY ?? frmVideo.Location.Y); frmVideo.TopMost = req.TopMost ?? true; frmVideo.FormBorderStyle = req.ShowWindowBorder == true ? FormBorderStyle.Sizable : FormBorderStyle.None; this.VideoManager.SetLayout(req.PanelID, req.LayoutName); frmVideo.WindowState = FormWindowState.Normal; frmVideo.Show(); }
/// <summary> /// 获取指定的窗口 /// </summary> /// <param name="id"></param> /// <returns></returns> private FrmVideo getVideoFormByID(string id) { if (this.m_VideoFrmList.ContainsKey(id)) { return(this.m_VideoFrmList[id]); } var panel = this.VideoManager.CreateVideoPanel(id); FrmVideo ret = new FrmVideo(); ret.Show(); ret.SetVideoPanel(panel); this.m_VideoFrmList.Add(id, ret); return(ret); }