예제 #1
0
        public void AddNewRoom(string name)
        {
            _rooms.Add(new Room(Guid.NewGuid().ToString(), name));

            SortDevices();

            RoomStructureChanged?.Invoke(this);
        }
예제 #2
0
 public void RemoveDevice(Device device)
 {
     _devices.Remove(device);
     device.Room.RemoveDevice(device);
     if (_selectedDevices != null && _selectedDevices.Contains(device))
     {
         _selectedDevices.Remove(device);
     }
     RoomStructureChanged?.Invoke(this);
 }
예제 #3
0
        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);
        }
예제 #4
0
 public void RenameDevice(Device device, string newName)
 {
     device.Caption = newName;
     SortDevices();
     RoomStructureChanged?.Invoke(this);
 }