// 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); } }
// Get cameras group by name public Group GetCamerasGroupByName(string name) { return(camerasGroups.GetGroupByName(name)); }
// Get views group by name public Group GetViewsGroupByName(string name) { return(viewsGroups.GetGroupByName(name)); }