| | |
| | | { |
| | | public SetPir() |
| | | { |
| | | Tag = "PirMain"; |
| | | Tag = "PirView"; |
| | | } |
| | | |
| | | public void Show(Action action) |
| | | public void Show() |
| | | { |
| | | #region 界面布局 |
| | | this.BackgroundColor = CSS.CSS_Color.viewMiddle; |
| | |
| | | this.AddChidren(topView.FLayoutView()); |
| | | topView.clickBackBtn.MouseUpEventHandler += (e, sen) => |
| | | { |
| | | action(); |
| | | RemoveFromParent(); |
| | | }; |
| | | topView.topNameBtn.TextID = StringId.setlogic; |
| | |
| | | editNameFLayout.btnNextIcon.Width = Application.GetRealWidth(28); |
| | | editNameFLayout.btnNextIcon.UnSelectedImagePath = "LogicIcon/editname.png"; |
| | | viewLayout.AddChidren(editNameFLayout.FLayoutView()); |
| | | ///版本升级 |
| | | FrameLayout50 banbenshengjiFL = new FrameLayout50(); |
| | | banbenshengjiFL.btnText.Text = Language.StringByID(StringId.banbenshengji); |
| | | banbenshengjiFL.frameLayout.Y = editNameFLayout.frameLayout.Bottom; |
| | | viewLayout.AddChidren(banbenshengjiFL.FLayoutView()); |
| | | /////版本升级 |
| | | //FrameLayout50 banbenshengjiFL = new FrameLayout50(); |
| | | //banbenshengjiFL.btnText.Text = Language.StringByID(StringId.banbenshengji); |
| | | //banbenshengjiFL.frameLayout.Y = editNameFLayout.frameLayout.Bottom; |
| | | //viewLayout.AddChidren(banbenshengjiFL.FLayoutView()); |
| | | |
| | | var versions = Pir.currPir.versions.Find((c)=>c.module== "fw_version"); |
| | | if (versions == null) |
| | | { |
| | | versions = new Entity.VersionInfo(); |
| | | } |
| | | ///版本号:v1.3.5 |
| | | FrameLayout50 banbenhaoFLayout = new FrameLayout50(); |
| | | banbenhaoFLayout.btnNextIcon.Visible = false; |
| | | banbenhaoFLayout.btnText.Text = Language.StringByID(StringId.banbenhao) + ":v1.3.5"; |
| | | banbenhaoFLayout.frameLayout.Y = banbenshengjiFL.frameLayout.Bottom; |
| | | banbenhaoFLayout.btnText.Text = Language.StringByID(StringId.banbenhao) + ":"+ versions.version; |
| | | banbenhaoFLayout.btnText.Width = Application.GetRealWidth(280); |
| | | banbenhaoFLayout.frameLayout.Y = editNameFLayout.frameLayout.Bottom;// banbenshengjiFL.frameLayout.Bottom; |
| | | viewLayout.AddChidren(banbenhaoFLayout.FLayoutView()); |
| | | //删除 |
| | | FrameLayout frameLayout = new FrameLayout |
| | |
| | | editNameFLayout.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | List<string> list = new List<string>(); |
| | | Method method = new Method(); |
| | | PirMethod method = new PirMethod(); |
| | | method.EditControlName(StringId.editName, list, Pir.currPir.name, (name, dialog) => |
| | | { |
| | | Method.ThreadSend(new Control { deviceId = Pir.currPir.deviceId, name = name }, (responsePackNew) => |
| | | PirMethod.ThreadSend(new Control { deviceId = Pir.currPir.deviceId, name = name }, (responsePackNew) => |
| | | { |
| | | dialog.Close(); |
| | | editNameFLayout.btnEditText.Text = name; |
| | |
| | | tipPopView.TipBox(StringId.tip, text, (dialog) => |
| | | { |
| | | |
| | | Method.ThreadSend(new Control { deviceId = Pir.currPir.deviceId }, (responsePackNew) => |
| | | PirMethod.ThreadSend(new Control { deviceId = Pir.currPir.deviceId }, (responsePackNew) => |
| | | { |
| | | var pir = Pir.pirDeviceList.Find((c) => c.deviceId == Pir.currPir.deviceId); |
| | | if (pir != null) |
| | |
| | | Pir.pirDeviceList.Remove(Pir.currPir); |
| | | } |
| | | dialog.Close(); |
| | | action(); |
| | | this.RemoveFromParent(); |
| | | for (int i = MainPage.BasePageView.ChildrenCount - 1; 0 <= i; i--) |
| | | { |
| | | var view = MainPage.BasePageView.GetChildren(i); |
| | | if (view.GetType() == typeof(PirMain)) |
| | | { |
| | | view.RemoveFromParent(); |
| | | } |
| | | } |
| | | PirMethod.RemoveView("PirMain"); |
| | | }, "删除", "dialog", null, dialog); |
| | | |
| | | }, () => |
| | |
| | | #endregion |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 移除界面 |
| | | /// </summary> |
| | | public override void RemoveFromParent() |
| | | { |
| | | //刷新PirMain界面 |
| | | PirMethod.RefreshView("PirMain"); |
| | | base.RemoveFromParent(); |
| | | |
| | | } |
| | | } |
| | | } |