| | |
| | | //生成文件 |
| | | room.Save(); |
| | | //备份 |
| | | HdlAutoBackupLogic.AddOrEditorFile(room.FileName); |
| | | HdlBackupLogic.Current.AddOrEditorAutoBackFileStatu(room.FileName); |
| | | if (refreshRoomView == true) |
| | | { |
| | | //刷新房间视图列表 |
| | |
| | | { |
| | | Global.DeleteFilebyHomeId(room.BackgroundImage); |
| | | //删除备份 |
| | | HdlAutoBackupLogic.DeleteFile(room.BackgroundImage); |
| | | HdlBackupLogic.Current.DeleteAutoBackFileStatu(room.BackgroundImage); |
| | | } |
| | | } |
| | | //我的喜爱 |
| | |
| | | //删除文件 |
| | | Global.DeleteFilebyHomeId(roomFilePath); |
| | | } |
| | | HdlAutoBackupLogic.DeleteFile(roomFilePath); |
| | | HdlBackupLogic.Current.DeleteAutoBackFileStatu(roomFilePath); |
| | | |
| | | if (refreshLeftView == true) |
| | | { |
| | |
| | | room.ListDevice.Remove(mainkeys); |
| | | room.Save(); |
| | | //更改自动备份 |
| | | HdlAutoBackupLogic.AddOrEditorFile(room.FileName); |
| | | HdlBackupLogic.Current.AddOrEditorAutoBackFileStatu(room.FileName); |
| | | |
| | | //递归:删除掉以前的旧数据导致的多个房间的问题 |
| | | this.DeleteDevice(device, deleteReal); |
| | |
| | | loveRoom.ListDevice.Remove(mainkeys); |
| | | loveRoom.Save(); |
| | | //更改自动备份 |
| | | HdlAutoBackupLogic.AddOrEditorFile(loveRoom.FileName); |
| | | HdlBackupLogic.Current.AddOrEditorAutoBackFileStatu(loveRoom.FileName); |
| | | //添加收藏设备时,需要刷新主页 |
| | | UserView.UserPage.Instance.RefreshAllForm = true; |
| | | } |
| | |
| | | /// <summary> |
| | | /// 获取排序后的楼层 |
| | | /// </summary> |
| | | /// <param name="i_dicFloor">需要排序的楼层集合,如果设置为null,则会返回当前住宅排序了的楼层</param> |
| | | /// <returns></returns> |
| | | public Dictionary<string, string> GetFloorSortList() |
| | | public Dictionary<string, string> GetFloorSortList(Dictionary<string, string> i_dicFloor = null) |
| | | { |
| | | if (i_dicFloor == null) |
| | | { |
| | | i_dicFloor = Config.Instance.Home.FloorDics; |
| | | } |
| | | //没有楼层 |
| | | if (Config.Instance.Home.FloorDics.Count == 0) |
| | | if (i_dicFloor.Count == 0) |
| | | { |
| | | return new Dictionary<string, string>(); |
| | | } |
| | | //从一堆文字中,获取这一堆文字里面数字字符串的最长长度 |
| | | var listName = new List<string>(); |
| | | foreach (var floorName in Config.Instance.Home.FloorDics.Values) |
| | | foreach (var floorName in i_dicFloor.Values) |
| | | { |
| | | listName.Add(floorName); |
| | | } |
| | | int numberLength = HdlCommonLogic.Current.GetNumberMaxLength(listName); |
| | | |
| | | var listSort = new List<string[]>(); |
| | | foreach (var floorId in Config.Instance.Home.FloorDics.Keys) |
| | | foreach (var floorId in i_dicFloor.Keys) |
| | | { |
| | | var strArry = new string[2]; |
| | | strArry[0] = floorId; |
| | | strArry[1] = string.Empty; |
| | | |
| | | string value = string.Empty; |
| | | string floorName = Config.Instance.Home.FloorDics[floorId]; |
| | | string floorName = i_dicFloor[floorId]; |
| | | foreach (var c in floorName) |
| | | { |
| | | if (char.IsNumber(c) == true) |
| | |
| | | var dic = new Dictionary<string, string>(); |
| | | foreach (var strArry in listSort) |
| | | { |
| | | dic[strArry[0]] = Config.Instance.Home.FloorDics[strArry[0]]; |
| | | dic[strArry[0]] = i_dicFloor[strArry[0]]; |
| | | } |
| | | return dic; |
| | | } |
| | |
| | | { |
| | | //生成房间和楼层的json |
| | | var roomInfo = string.Empty; |
| | | TemplateData.TemplateCommonLogic.Current.CrearWriteRoomTemplateData(ref roomInfo); |
| | | HdlTemplateCommonLogic.Current.CrearWriteRoomTemplateData(ref roomInfo); |
| | | |
| | | var realMain = ZbGateway.MainGateWay; |
| | | //创建文件对象 |