示例#1
0
        // On dragging object dropperd
        private void viewGrid_DragDrop(object sender, System.Windows.Forms.DragEventArgs e)
        {
            string name = (string)e.Data.GetData(typeof(string));

            string[] nameParts = name.Split('\\');
            Group    group     = null;
            Camera   camera    = null;

            // get group
            if (nameParts.Length > 1)
            {
                group = groups.GetGroupByName(string.Join("\\", nameParts, 0, nameParts.Length - 1));
            }

            // get camera
            camera = cameras.GetCamera(nameParts[nameParts.Length - 1], group);

            if (camera != null)
            {
                Point cpt = viewGrid.PointToClient(new Point(e.X, e.Y));
                Point pt  = viewGrid.SetLabel(name, cpt);

                // set camera
                view.SetCamera(pt.Y, pt.X, camera.ID);
            }
        }
示例#2
0
 // Get cameras group by name
 public Group GetCamerasGroupByName(string name)
 {
     return(camerasGroups.GetGroupByName(name));
 }
示例#3
0
 // Get views group by name
 public Group GetViewsGroupByName(string name)
 {
     return(viewsGroups.GetGroupByName(name));
 }