old mode 100644
new mode 100755
| | |
| | | return $"Room_{Id}.json"; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 房间id--使用guid |
| | | /// Guid.NewGuid().ToString() |
| | |
| | | foreach (var roomFilePath in Config.Instance.Home.RoomFilePathList) |
| | | { |
| | | var room = GetRoomByFilePath(roomFilePath); |
| | | System.Console.WriteLine(roomFilePath); |
| | | System.Console.WriteLine(room?.FileName); |
| | | System.Console.WriteLine(room?.Name); |
| | | |
| | | if (null != room) |
| | | { |
| | | if (room.IsSharedRoom) |
| | | { |
| | | var sharedName = $"{room.Name}({Language.StringByID(R.MyInternationalizationString.Shared)})"; |
| | | if (Lists.Find((obj) => obj.Name == sharedName) == null) |
| | | { |
| | | |
| | | } |
| | | room.Name = $"{room.Name}({Language.StringByID(R.MyInternationalizationString.Shared)})"; |
| | | room.Save(); |
| | | room.Name = $"({Language.StringByID(R.MyInternationalizationString.Shared)}){room.Name}"; |
| | | } |
| | | Lists.Add(room); |
| | | } |
| | |
| | | /// <param name="device">设备对象</param> |
| | | public List<Room> GetRoomByDevice(CommonDevice device) |
| | | { |
| | | var deviceUI = new DeviceUI { }; |
| | | deviceUI.DeviceFileName = device.FilePath; |
| | | var deviceUI = new DeviceUI { };
|
| | | deviceUI.DeviceAddr = device.DeviceAddr;
|
| | | deviceUI.DeviceEpoint = device.DeviceEpoint; |
| | | |
| | | return Lists.FindAll((obj) => obj.DeviceUIFilePathList.Contains(deviceUI.FileName)); |
| | | } |
| | | |
| | |
| | | HdlAutoBackupLogic.AddOrEditorFile(device.FilePath); |
| | | |
| | | DeviceUI deviceUI = Common.LocalDevice.Current.GetDeviceUI(device); |
| | | deviceUI.DeviceFileName = device.FilePath; |
| | | if (backUpUI == true) |
| | | { |
| | | deviceUI.ReSave(); |
| | | } |
| | | else |
| | | { |
| | | deviceUI.Save(); |
| | | } |
| | | |
| | | //添加自动备份 |
| | | HdlAutoBackupLogic.AddOrEditorFile(deviceUI.FileName); |
| | | |
| | | if (DeviceUIFilePathList.Contains(deviceUI.FileName) == false) |
| | | { |
| | | DeviceUIFilePathList.Add(deviceUI.FileName); |
| | |
| | | return; |
| | | } |
| | | DeviceUI deviceUI = new DeviceUI(); |
| | | deviceUI.DeviceFileName = device.FilePath; |
| | | deviceUI.DeviceAddr = device.DeviceAddr;
|
| | | deviceUI.DeviceEpoint = device.DeviceEpoint; |
| | | |
| | | //根据设备,获取所在的房间,因为它删的不一定是当前房间 |
| | | List<Room> listroom = this.GetRoomByDevice(device); |