void uiPreset_DeletePresetEvent(object sender, Code.Camera_Goto e)
 {
     if (MessageBox.Show("Bạn có muốn xóa Preset này không?", "Thông báo", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
     {
         for (int j = 0; j < e.Camera.Count; j++)
         {
             for (int i = 0; i < App.DataCamera.Count; i++)
             {
                 if (App.DataCamera[i].id == e.Camera[j].camera_id)
                 {
                     if (App.DataCamera[i].m_lUserID == -1)
                     {
                         App.DataCamera[i].Login();
                     }
                     if (App.DataCamera[i].m_lUserID != -1)
                     {
                         CHCNetSDK.NET_DVR_PTZPreset_Other(App.DataCamera[i].m_lUserID, 1, CHCNetSDK.CLE_PRESET, (uint)e.Camera[j].Postion);
                     }
                 }
             }
         }
         App.DataPreset.Remove(e);
         this.DrawMap();
     }
 }
        void uiPreset_MovePresetEvent(object sender, Code.Camera_Goto e)
        {
            UIMapPreset uiPreset = sender as UIMapPreset;
            Point       p        = Mouse.GetPosition(this.UIMapContent);

            uiPreset.setLeft(p.X - origContentMousePoint.X);
            uiPreset.setTop(p.Y - origContentMousePoint.Y);
            for (int i = 0; i < App.DataPreset.Count; i++)
            {
                if (App.DataPreset[i].id == e.id)
                {
                    App.DataPreset[i].left = p.X;
                    App.DataPreset[i].top  = p.Y;
                }
            }
        }
Esempio n. 3
0
        public void Add(Camera_Goto preset)
        {
            if (preset.id == 0)
            {
                if (this.Children.Count == 0)
                {
                    preset.id = 1;
                }
                else
                {
                    preset.id = this.Children[this.Count - 1].id + 1;
                }
            }

            for (int i = 0; i < this.Children.Count; i++)
            {
                if (this.Children[i].id == preset.id)
                {
                    return;
                }
            }
            this.Children.Add(preset);
            this.Children.Sort();
        }
Esempio n. 4
0
 public void Remove(Camera_Goto cam)
 {
     this.Children.Remove(cam);
     this.Children.Sort();
 }