Пример #1
0
 public void AddDevice(Device device)
 {
     if (!Devices.ContainsKey(device.Name.ToLower()))
     {
         Devices.Add(device.Name.ToLower(), device);
     }
 }
Пример #2
0
 public void AddDevice(Device device)
 {
     if (IsNotDevice(device.NameId))
     {
         Devices.Add(device);
     }
 }
Пример #3
0
        private Control CreateControl(Device device)
        {
            DataForControl data = new DataForControl(_house, _room, device);

            if (device is Lamp)
            {
                return new LampControl(data);
            }
            if (device is ClimatControl)
            {
                return new ClimatControlControl(data);
            }
            if (device is Tv)
            {
                return new TvControl(data);
            }
            return null;
        }
 public DataForControl(House house, Room room, Device device)
 {
     _device = device;
     _house = house;
     _room = room;
 }
Пример #5
0
 public void AddDevice(string room, Device device)
 {
     if(Rooms.ContainsKey(room.ToLower()))
         Rooms[room.ToLower()].AddDevice(device);
 }