| | |
| | | { |
| | | Action action = () => |
| | | { |
| | | var delResult = SpatialInfo.CurrentSpatial.DelRoom(room); |
| | | if (delResult == StateCode.SUCCESS) |
| | | var waitPage = new Loading(); |
| | | waitPage.Start(); |
| | | new Thread(() => |
| | | { |
| | | foreach (var f in FunctionList.List.GetDeviceFunctionList()) |
| | | try |
| | | { |
| | | if (f.roomIds.Contains(room.roomId)) |
| | | var delResult = SpatialInfo.CurrentSpatial.DelRoom(room); |
| | | if (delResult == StateCode.SUCCESS) |
| | | { |
| | | f.roomIds.Remove(room.roomId); |
| | | foreach (var f in FunctionList.List.GetDeviceFunctionList()) |
| | | { |
| | | if (f.roomIds.Contains(room.roomId)) |
| | | { |
| | | f.roomIds.Remove(room.roomId); |
| | | } |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | //删除事件回调 |
| | | this.deleteAction?.Invoke(); |
| | | this.RemoveFromParent(); |
| | | }); |
| | | } |
| | | } |
| | | //删除事件回调 |
| | | this.deleteAction?.Invoke(); |
| | | this.RemoveFromParent(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"添加房间失败msg:{ex.Message}"); |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | waitPage.Hide(); |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | new PublicAssmebly().TipOptionMsg(StringId.Tip, StringId.DeleteRoomTip, action); |
| | | }; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 显示背景图选择选项 |