| | |
| | | this.DeleteDevice(device); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 删除我的喜爱的设备 |
| | | /// </summary> |
| | | /// <param name="device">要删除的设备对象</param> |
| | | public void DeleteLoveDevice(CommonDevice device) |
| | | { |
| | | if (device == null) |
| | | { |
| | | return; |
| | | } |
| | | //我的喜爱 |
| | | var loveRoom = this.GetLoveRoom();
|
| | | if (loveRoom != null)
|
| | | {
|
| | | string deviceFile = device.FilePath;
|
| | | //移除缓存
|
| | | if (loveRoom.DeviceUIFilePathList.Contains(deviceFile) == false)
|
| | | {
|
| | | return;
|
| | | }
|
| | | loveRoom.DeviceUIFilePathList.Remove(deviceFile);
|
| | | loveRoom.DeviceUIList.RemoveAll((obj) => obj.FileName == deviceFile);
|
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ◆ 获取设备_________________________ |