| | |
| | | bool isFrist = true; |
| | | foreach (var device in deviceList) |
| | | { |
| | | FrameLayout row = new FrameLayout() |
| | | var row = new RowLayout() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | LineColor = 0x00000000, |
| | | }; |
| | | contentView.AddChidren(row); |
| | | if(device.spk == SPK.IpCam_Imou) |
| | | { |
| | | var btnDel = new Button() |
| | | { |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | BackgroundColor = CSS_Color.WarningColor, |
| | | TextID = StringId.Del, |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | row.AddRightView(btnDel); |
| | | |
| | | btnDel.MouseUpEventHandler = (sender, e) => { |
| | | Action action = () => { |
| | | var waitPage = new Loading(); |
| | | this.AddChidren(waitPage); |
| | | waitPage.Start(""); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | | { |
| | | var http = new HttpServerRequest(); |
| | | var result = http.Delete3tyDevice( device.deviceId); |
| | | if (result.Code == StateCode.SUCCESS) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | Load3tyBrandDeviceList(); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new PublicAssmebly().TipMsgAutoClose(Language.StringByID(StringId.OperationFailed)+$"({result.Code})", true); |
| | | }); |
| | | } |
| | | }catch (Exception ex) |
| | | { |
| | | MainPage.Log($"删除第三方设备失败:{ex.Message}"); |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if(waitPage!= null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | new PublicAssmebly().TipOptionMsg(StringId.Tip, Language.StringByID(StringId.AreYouSureToDeleteThisDevice), action); |
| | | }; |
| | | } |
| | | |
| | | if (isFrist) |
| | | { |
| | |
| | | contentView.BeginHeaderRefreshing(); |
| | | }); |
| | | break; |
| | | case SPK.SensorMmvPose: |
| | | case SPK.SenesorMegahealth: |
| | | case SPK.SenesorMegahealth2: |
| | | var smPage = new SenesorMegahealthManagerPage(); |