public void AddNewRoom(string name) { _rooms.Add(new Room(Guid.NewGuid().ToString(), name)); SortDevices(); RoomStructureChanged?.Invoke(this); }
public void RemoveDevice(Device device) { _devices.Remove(device); device.Room.RemoveDevice(device); if (_selectedDevices != null && _selectedDevices.Contains(device)) { _selectedDevices.Remove(device); } RoomStructureChanged?.Invoke(this); }
public void MoveDeviceToRoom(Device device, Room target) { if (device.Room.Id == target.Id) { return; } device.Room.RemoveDevice(device); target.AddDevice(device); device.Room = target; SortDevices(); RoomStructureChanged?.Invoke(this); }
public void RenameDevice(Device device, string newName) { device.Caption = newName; SortDevices(); RoomStructureChanged?.Invoke(this); }