public void AddDevice(Device device) { if (!Devices.ContainsKey(device.Name.ToLower())) { Devices.Add(device.Name.ToLower(), device); } }
public void AddDevice(Device device) { if (IsNotDevice(device.NameId)) { Devices.Add(device); } }
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; }
public void AddDevice(string room, Device device) { if(Rooms.ContainsKey(room.ToLower())) Rooms[room.ToLower()].AddDevice(device); }