| | |
| | | } |
| | | Config.Instance.Home.InitFloor(); |
| | | |
| | | RefreshRoomListView(); |
| | | CurrentRoom.RefreshRoomListView(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 刷新房间视图列表 |
| | | /// </summary> |
| | | public static void RefreshRoomListView() |
| | | public void RefreshRoomListView() |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | |
| | | Global.DeleteFilebyHomeId(roomFilePath); |
| | | Lists.Remove(room); |
| | | HdlAutoBackupLogic.DeleteFile(roomFilePath); |
| | | |
| | | CurrentRoom.RefreshRoomListView(); |
| | | |
| | | return true; |
| | | } |
| | | |
| | |
| | | /// <param name="iconPathType">I场景背景图片来源类型 图片来源 0--本地图库 1--拍照 2--系统图库 默认0</param> |
| | | public async System.Threading.Tasks.Task<int> AddScene(string sceneName, string sceneIconPath, List<ZigBee.Device.Scene.AddSceneMemberData> commons, int iconPathType) |
| | | { |
| | | var scenes = GetSceneUIsByFloorId(FloorId); |
| | | //var scenes = GetSceneUIsByFloorId(FloorId); |
| | | //if(scenes!=null && scenes.Count>0) |
| | | //{ |
| | | // if (scenes.Find(s => s.Name == sceneName) != null) |
| | |
| | | IconPathType = iconPathType, |
| | | AddSceneMemberDataList= commons |
| | | }; |
| | | sceneUI.Save(); |
| | | SceneUIList.Add(sceneUI); |
| | | SceneUIFilePathList.Add(sceneUI.FileName); |
| | | sceneUI.Save(); |
| | | Save(); |
| | | HdlAutoBackupLogic.AddOrEditorFile(sceneUI.FileName); |
| | | return 1; |
| | | } |
| | | return 0; |
| | |
| | | /// <summary> |
| | | /// 是否是收藏设备 |
| | | /// </summary> |
| | | /// <param name="room"></param> |
| | | /// <param name="filePath"></param> |
| | | /// <returns></returns> |
| | | public bool IsCollectInRoom(Room room,string filePath) |
| | | public bool IsCollectInRoom(string filePath) |
| | | { |
| | | if(room.IsLove) |
| | | { |
| | | return true; |
| | | } |
| | | if (GetLoveRoom().DeviceUIFilePathList.Find((obj) => obj == filePath) == null) |
| | | { |
| | | return false; |