| | |
| | | btnFunctionManagementTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(120), |
| | | Width = Application.GetRealWidth(220), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | |
| | | return; |
| | | } |
| | | } |
| | | var addResult = SpatialInfo.CurrentSpatial.AddRoom(room,out room);//检查room是否为云端返回的最新数据 |
| | | if (addResult == StateCode.SUCCESS) |
| | | var waitPage = new Loading(); |
| | | waitPage.Start(); |
| | | new Thread(() => |
| | | { |
| | | var deviceIds = new List<string>(); |
| | | foreach (var f in roomFunctions) |
| | | try |
| | | { |
| | | deviceIds.Add(f.deviceId); |
| | | } |
| | | var bindResult = FunctionList.List.FunctionsBindRooms(new List<string>() { room.roomId }, deviceIds); |
| | | if (bindResult == StateCode.SUCCESS) |
| | | { |
| | | foreach(var f in roomFunctions) |
| | | var addResult = SpatialInfo.CurrentSpatial.AddRoom(room, out room);//检查room是否为云端返回的最新数据 |
| | | if (addResult == StateCode.SUCCESS) |
| | | { |
| | | f.roomIds.Add(room.roomId); |
| | | var deviceIds = new List<string>(); |
| | | foreach (var f in roomFunctions) |
| | | { |
| | | deviceIds.Add(f.deviceId); |
| | | } |
| | | if (deviceIds.Count > 0) |
| | | { |
| | | var bindResult = FunctionList.List.FunctionsBindRooms(new List<string>() { room.roomId }, deviceIds); |
| | | if (bindResult == StateCode.SUCCESS) |
| | | { |
| | | foreach (var f in roomFunctions) |
| | | { |
| | | f.roomIds.Add(room.roomId); |
| | | } |
| | | room.GetRoomFunctions(true); |
| | | } |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | backAction(room); |
| | | RemoveFromParent(); |
| | | }); |
| | | } |
| | | room.GetRoomFunctions(true); |
| | | } |
| | | else |
| | | catch (Exception ex) |
| | | { |
| | | //Utlis.ShowTip(Language.StringByID(StringId.EditFunctionInfoFail) + "\r\nCode:" + pack.Code); |
| | | MainPage.Log($"添加房间失败msg:{ex.Message}"); |
| | | } |
| | | backAction(room); |
| | | RemoveFromParent(); |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | waitPage.Hide(); |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | } |
| | | |
| | |
| | | pictureOptionView.Parent.RemoveFromParent(); |
| | | Action<string> action = (obj) => { |
| | | room.backgroundImage = obj; |
| | | btnRoomBg.ImageBytes = null;//解决有ImageBytes不加载ImagePath |
| | | btnRoomBg.ImagePath = room.backgroundImage; |
| | | }; |
| | | |