Exemple #1
0
 // Delete cameras group
 // delete cameras group if it is empty or return false otherwise
 public bool DeleteCamerasGroup(Group group)
 {
     // check if there are subgroups in the group
     foreach (Group g in camerasGroups)
     {
         if (g.Parent == group)
         {
             return(false);
         }
     }
     // check if there are cameras in the group
     foreach (Camera c in cameras)
     {
         if (c.Parent == group)
         {
             return(false);
         }
     }
     camerasGroups.Remove(group);
     // save
     SaveCameras();
     return(true);
 }
Exemple #2
0
 // Delete views group
 // delete views group if it is empty or return false otherwise
 public bool DeleteViewsGroup(Group group)
 {
     // check if there are subgroups in the group
     foreach (Group g in viewsGroups)
     {
         if (g.Parent == group)
         {
             return(false);
         }
     }
     // check if there are view in the group
     foreach (View v in views)
     {
         if (v.Parent == group)
         {
             return(false);
         }
     }
     viewsGroups.Remove(group);
     // save
     SaveViews();
     return(true);
 }