void uiCamera_ConnectCameraEvent(object sender, Code.Camera e) { if (e != null) { if (this._alarm > -1) { Code.Camera_Preset alarmPos = new Code.Camera_Preset() { camera_id = e.id, Postion = e.FindFreePreset() }; SmallControlCamera view = new SmallControlCamera(); view.preset = alarmPos; view.Alarm = this._alarm; view.Camera = e; view.Width = 1366; view.Height = 768; view.setLeft(0); view.setTop(0); view.CloseEvent += view_CloseEvent; this.UIMapContent.Children.Add(view); this._alarm = -1; } } }
void uiAlarm_EditConnectEvent(object sender, Tuple<int, int> e) { SmallControlCamera view = new SmallControlCamera(); if (App.DataAlarm[e.Item2].Cameras != null && App.DataAlarm[e.Item2].Cameras.Count > 0) view.preset = App.DataAlarm[e.Item2].Cameras[e.Item1]; view.Alarm = e.Item2; view.Width = 1366; view.Height = 768; view.setLeft(0); view.setTop(0); view.CloseEvent += view_CloseEvent; this.UIMapContent.Children.Add(view); this._alarm = -1; }