Пример #1
0
 //adds every Unit with the addresses in the _currentUnitIds List to the wanted group and resets the list and goes to main menu
 private void AddAddressToGroup(object sender, EventArgs e)
 {
     foreach (int index in _currentUnitIds)
     {
         LightingUnit CurrentUnit = DALIController.FindUnitWithAddress(index);
         DALIController.AddUnitToGroup(CurrentUnit, _buttons.IndexOf((Button)sender));
     }
     _currentUnitIds.Clear();
     SetUpFirstButtons();
 }
Пример #2
0
        public void RemoveUnitFromAllGroupsTest()
        {
            Controller.AddUnitToGroup(Controller.AllLights[0], 0);
            Controller.AddUnitToGroup(Controller.AllLights[0], 1);

            Controller.RemoveUnitFromAllGroups(Controller.AllLights[0]);

            foreach (DALIGroup group in Controller._groups)
            {
                Assert.IsEmpty(group.GroupOfLights);
            }
        }