| | |
| | | topView.topNameBtn.TextID = StringId.shebeigaunli; |
| | | topView.topIconBtn.Visible = true; |
| | | this.AddChidren(topView.FLayoutView()); |
| | | topView.clickBackBtn.MouseUpEventHandler += (sender, e) => { |
| | | topView.clickBackBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | action(); |
| | | this.RemoveFromParent(); |
| | | }; |
| | |
| | | //关闭刷新View; |
| | | vv.EndHeaderRefreshing(); |
| | | //获取列表 |
| | | Method.GetPirDeviceList(this,() => |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | Method.GetPirDeviceList(this, () => |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | //刷新界面 |
| | | UIView(vv); |
| | | }); |
| | | }); |
| | | }); |
| | | }); |
| | | |
| | | }; |
| | | #endregion |
| | |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = TextSize.text12, |
| | | TextColor = 0xFF67D569,// CSS.CSS_Color.textColor, |
| | | SelectedTextColor =CSS.CSS_Color.textRedColor, |
| | | SelectedTextColor = CSS.CSS_Color.textRedColor, |
| | | IsBold = true, |
| | | }; |
| | | devfLayout.AddChidren(stateTextBtn); |
| | | if (pirDevice.online) { |
| | | if (pirDevice.online) |
| | | { |
| | | stateIconBtn.IsSelected = true; |
| | | stateTextBtn.IsSelected = true; |
| | | } else { |
| | | } |
| | | else |
| | | { |
| | | stateIconBtn.IsSelected = false; |
| | | stateTextBtn.IsSelected = false; |
| | | } |
| | |
| | | } |
| | | delBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | |
| | | var Function = delBtn.Tag as Entity.Function; |
| | | //加载log |
| | | Loading loading = new Loading(); |
| | | this.AddChidren(loading); |
| | | HDL_ON.DAL.Server.ResponsePackNew responsePackNew = null; |
| | | loading.Start(); |
| | | new System.Threading.Thread(() => |
| | | string text = Language.StringByID(StringId.shanchushebei) + Function.name + "?"; |
| | | TipPopView tipPopView = new TipPopView(); |
| | | tipPopView.TipBox(StringId.tip, text, (dialog) => |
| | | { |
| | | try |
| | | //加载log |
| | | Loading loading = new Loading(); |
| | | dialog.AddChidren(loading); |
| | | HDL_ON.DAL.Server.ResponsePackNew responsePackNew = null; |
| | | loading.Start(); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | responsePackNew = PirSend.DeleteDevice(Function.deviceId); |
| | | } |
| | | catch { } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | try |
| | | { |
| | | loading.Hide(); |
| | | try |
| | | responsePackNew = PirSend.DeleteDevice(Function.deviceId); |
| | | } |
| | | catch { } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "") |
| | | loading.Hide(); |
| | | try |
| | | { |
| | | var function = pirDevice.FunctioList.Find((c)=>c.sid== Function.sid); |
| | | if (function != null) |
| | | if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "") |
| | | { |
| | | pirDevice.FunctioList.Remove(Function); |
| | | if (Pir.currPir != null && pirDevice.sid == Pir.currPir.sid) |
| | | dialog.Close(); |
| | | var function = pirDevice.FunctioList.Find((c) => c.sid == Function.sid); |
| | | if (function != null) |
| | | { |
| | | Pir.currPir.FunctioList = pirDevice.FunctioList; |
| | | pirDevice.FunctioList.Remove(Function); |
| | | if (Pir.currPir != null && pirDevice.sid == Pir.currPir.sid) |
| | | { |
| | | Pir.currPir.FunctioList = pirDevice.FunctioList; |
| | | } |
| | | } |
| | | UIView(vv); |
| | | } |
| | | UIView(vv); |
| | | else |
| | | { |
| | | Method method = new Method(); |
| | | method.ErrorShow(responsePackNew); |
| | | } |
| | | } |
| | | catch { } |
| | | |
| | | else |
| | | { |
| | | Method method = new Method(); |
| | | method.ErrorShow(responsePackNew); |
| | | } |
| | | } |
| | | catch { } |
| | | }); |
| | | } |
| | | |
| | | }); |
| | | } |
| | | |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }, () => { }, false); |
| | | }; |
| | | EventHandler<MouseEventArgs> editClick = (sender, e) => |
| | | { |
| | |
| | | areaBtn.MouseUpEventHandler += editClick; |
| | | nextIconBtn.MouseUpEventHandler += editClick; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | { |
| | | list.Add(Pir.pirDeviceList[b].name); |
| | | } |
| | | Method methodView = new Method(); |
| | | Method methodView = new Method(); |
| | | methodView.EditControlName(StringId.xiugaimingzi, list, pirclick.name, (name, view) => |
| | | { |
| | | pirclick.name = name; |
| | | HDL_ON.DAL.Server.ResponsePackNew responsePackNew = null; |
| | | //加载log |
| | | Loading loading = new Loading(); |
| | | view.AddChidren(loading); |
| | | HDL_ON.DAL.Server.ResponsePackNew responsePackNew = null; |
| | | loading.Start(); |
| | | new System.Threading.Thread(() => |
| | | { |
| | |
| | | |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | },()=> { |
| | | }, () => |
| | | { |
| | | NewSwitchView(pirclick, vv); |
| | | },false); |
| | | }, false); |
| | | |
| | | } |
| | | else |
| | |
| | | TipPopView tipPopView = new TipPopView(); |
| | | tipPopView.TipBox(StringId.tip, text, (dialog) => |
| | | { |
| | | HDL_ON.DAL.Server.ResponsePackNew responsePackNew = null; |
| | | //加载log |
| | | Loading loading = new Loading(); |
| | | dialog.AddChidren(loading); |
| | | HDL_ON.DAL.Server.ResponsePackNew responsePackNew = null; |
| | | loading.Start(); |
| | | new System.Threading.Thread(() => |
| | | { |
| | |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | } |