private void ResetLayout() { foreach (LayoutItem li in SavedLayout) { switch (li.ObjectTypeId) { case 1: VolumeLevel vl = GetMicrophone(li.ObjectId); if (vl != null) { vl.Location = new Point(li.LayoutRectangle.X, li.LayoutRectangle.Y); vl.Size = new Size(li.LayoutRectangle.Width, li.LayoutRectangle.Height); } break; case 2: CameraWindow cw = GetCameraWindow(li.ObjectId); if (cw != null) { cw.Location = new Point(li.LayoutRectangle.X, li.LayoutRectangle.Y); cw.Size = new Size(li.LayoutRectangle.Width, li.LayoutRectangle.Height); } break; case 3: FloorPlanControl fp = GetFloorPlan(li.ObjectId); if (fp != null) { fp.Location = new Point(li.LayoutRectangle.X, li.LayoutRectangle.Y); fp.Size = new Size(li.LayoutRectangle.Width, li.LayoutRectangle.Height); } break; } } }
//*YL*----------------------------------------------------- private void ylResetLayout() { int iCameraCt = 4; foreach (LayoutItem li in SavedLayout) { switch (li.ObjectTypeId) { case 1: VolumeLevel vl = GetMicrophone(li.ObjectId); if (vl != null) { vl.Location = new Point(li.LayoutRectangle.X, li.LayoutRectangle.Y); vl.Size = new Size(li.LayoutRectangle.Width, li.LayoutRectangle.Height); } break; case 2: CameraWindow cw = GetCameraWindow(li.ObjectId); //System.Console.WriteLine("***** Name: " + li.ObjectId.ToString() + "****" + this.Width.ToString() + "x" + this.Height.ToString()); //System.Console.WriteLine("***** Name: <" + strNodeName + "><" + cw.Camobject.name + ">\t****\t" + this.Width.ToString() + "x" + this.Height.ToString()); /* * string strWindowName = ""; * if ((cw.Camobject.name.IndexOf("NAE", StringComparison.OrdinalIgnoreCase) >= 0) || (cw.Camobject.name.IndexOf("Art", StringComparison.OrdinalIgnoreCase) >= 0)) * { * strWindowName = "NAE"; * } * else if (cw.Camobject.name.IndexOf("Broadway", StringComparison.OrdinalIgnoreCase) >= 0) * { * strWindowName = "Broadway"; * } * else if (cw.Camobject.name.IndexOf("Leytonstone", StringComparison.OrdinalIgnoreCase) >= 0) * { * strWindowName = "Leytonstone"; * } * else if (cw.Camobject.name.IndexOf("Mill", StringComparison.OrdinalIgnoreCase) >= 0) * { * strWindowName = "Mill"; * } */ if (cw != null) { //cw.Location = new Point(li.LayoutRectangle.X, li.LayoutRectangle.Y); //cw.Size = new Size(li.LayoutRectangle.Width, li.LayoutRectangle.Height); iCameraCt--; if (string.Compare(strNodeName, cw.strWindowName, true) == 0) { cw.bLocalCam = true; } else { cw.bLocalCam = false; } if (string.Compare(strActiveNode, cw.strWindowName, true) == 0) { cw.bInteraction = true; } else { cw.bInteraction = false; } //***************************************************** cw.iLayout = iStateLayout; if (this.iOnscreenMsgCt == 0) { cw.strOnscreenMsg = this.strOnscreenMsg; cw.iOnscreenMsgX = this.iOnscreenMsgX; cw.iOnscreenMsgY = this.iOnscreenMsgY; cw.iOnscreenMsgStyle = this.iOnscreenMsgStyle; cw.iOnscreenMsgXx = this.iOnscreenMsgXx; cw.iOnscreenMsgYy = this.iOnscreenMsgYy; } //***************************************************** if (iStateLayout == 1) { int ww = this.Width / 2 - iBGA; int hh = this.Height / 2 - iBGA; int iBGA2 = iBGA / 2; int iBGA3 = iBGA + iBGA2; //if (iCameraCt == 3) if (string.Compare(cw.strWindowName, "NAE", true) == 0) { cw.Location = new Point(iBGA2, iBGA2); cw.Size = new Size(ww, hh); } //else if (iCameraCt == 2) else if (string.Compare(cw.strWindowName, "Broadway", true) == 0) { cw.Location = new Point(iBGA3 + ww, iBGA2); cw.Size = new Size(ww, hh); } //else if (iCameraCt == 1) else if (string.Compare(cw.strWindowName, "Leytonstone", true) == 0) { cw.Location = new Point(iBGA2, iBGA3 + hh); cw.Size = new Size(ww, hh); } //else if (iCameraCt == 0) else if (string.Compare(cw.strWindowName, "Mill", true) == 0) { cw.Location = new Point(iBGA3 + ww, iBGA3 + hh); cw.Size = new Size(ww, hh); } } else if (iStateLayout == 2) { //if (iCameraCt == 3) if (string.Compare(cw.strWindowName, "NAE", true) == 0) { cw.Location = new Point(0, 0); cw.Size = new Size(iWw, iWh); } //else if (iCameraCt == 2) else if (string.Compare(cw.strWindowName, "Broadway", true) == 0) { cw.Location = new Point(iWw, 0); cw.Size = new Size(iWw, iWh); } //else if (iCameraCt == 1) else if (string.Compare(cw.strWindowName, "Leytonstone", true) == 0) { cw.Location = new Point(iWw * 2, 0); cw.Size = new Size(iWw, iWh); } //else if (iCameraCt == 0) else if (string.Compare(cw.strWindowName, "Mill", true) == 0) { cw.Location = new Point(iWw * 3, 0); cw.Size = new Size(iWw, iWh); } } else if ((iStateLayout == 3) || (iStateLayout == 4)) { int topline = this.Height - iWh; //if (string.Compare(strNodeName, strWindowName, true) == 0) if (cw.bLocalCam) { //cw.Location = new Point(25, 0); //cw.Size = new Size(700, 1050); cw.Location = new Point(0, 0); cw.Size = new Size(this.Width, this.Height); cw.SendToBack(); } else if (iCameraCt == 3) { cw.Location = new Point(0, topline); cw.Size = new Size(iWw, iWh); } else if (iCameraCt == 2) { cw.Location = new Point(iWw, topline); cw.Size = new Size(iWw, iWh); } else if (iCameraCt == 1) { cw.Location = new Point(iWw * 2, topline); cw.Size = new Size(iWw, iWh); } else if (iCameraCt == 0) { cw.Location = new Point(iWw * 3, topline); cw.Size = new Size(iWw, iWh); } } } break; case 3: FloorPlanControl fp = GetFloorPlan(li.ObjectId); if (fp != null) { fp.Location = new Point(li.LayoutRectangle.X, li.LayoutRectangle.Y); fp.Size = new Size(li.LayoutRectangle.Width, li.LayoutRectangle.Height); } break; } } }