Example #1
0
 //removes every Unit with the addresses in the _currentUnitIds List from the wanted group
 //clears _currentUnitIds and goes to main menu
 private void RemoveAddressFromGroup(object sender, EventArgs e)
 {
     foreach (int index in _currentUnitIds)
     {
         LightingUnit CurrentUnit = DALIController.FindUnitWithAddress(index);
         DALIController.RemoveUnitFromGroup(CurrentUnit, _buttons.IndexOf((Button)sender));
     }
     _currentUnitIds.Clear();
     SetUpFirstButtons();
 }
Example #2
0
 public void RemoveUnitFromGroupTest()
 {
     Controller.AddUnitToGroup(Controller.AllLights[0], 0);
     Controller.RemoveUnitFromGroup(Controller.AllLights[0], 0);
     Assert.IsEmpty(Controller._groups[0].GroupOfLights);
 }