| | |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | fLayout.AddChidren(text1Btn); |
| | | //可到分类-功能-电器操作使用 |
| | | //可到分类-功能-操作使用 |
| | | Button text2Btn = new Button |
| | | { |
| | | Width = Application.GetRealWidth(375 - 32), |
| | |
| | | this.AddChidren(namePatchView.FLayoutView()); |
| | | namePatchView.btnText1.TextID = StringId.yaokongqimingcheng; |
| | | namePatchView.btnText2.Text = control.name; |
| | | namePatchView.btnClick.MouseUpEventHandler += (sender,e) => { |
| | | |
| | | List<string> list = new List<string>(); |
| | | |
| | | for (int i = 0; i < Pir.currPir.FunctioList.Count; i++) |
| | | { |
| | | list.Add(Pir.currPir.FunctioList[i].name); |
| | | } |
| | | Method method = new Method(); |
| | | method.EditControlName(StringId.editName, list, control.name, (name, view) => |
| | | { |
| | | //加载log |
| | | Loading loading = new Loading(); |
| | | view.AddChidren(loading); |
| | | HDL_ON.DAL.Server.ResponsePackNew responsePackNew = null; |
| | | loading.Start(); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | | { |
| | | responsePackNew = PirSend.DeviceRename(control.deviceId, control.name); |
| | | } |
| | | catch { } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | loading.Hide(); |
| | | if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "") |
| | | { |
| | | view.Close(); |
| | | namePatchView.btnText2.Text = name; |
| | | function.name = name; |
| | | } |
| | | else |
| | | { |
| | | Method methodError = new Method(); |
| | | methodError.ErrorShow(responsePackNew,""); |
| | | } |
| | | |
| | | }); |
| | | } |
| | | |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | |
| | | }, () => { }); |
| | | }; |
| | | |
| | | //所属区域 |
| | | View.PatchView quyuPatchView = new View.PatchView(); |
| | | quyuPatchView.frameLayout.Y = namePatchView.frameLayout.Bottom; |
| | | this.AddChidren(quyuPatchView.FLayoutView()); |
| | | quyuPatchView.btnText1.TextID = StringId.suoshuquyu; |
| | | quyuPatchView.btnText2.Text=Intelligence.Automation.LogicMethod.GetGetRoomName(function); |
| | | quyuPatchView.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | Method method = new Method(); |
| | | method.ManagementPosition(function, () => |
| | | { |
| | | //更新区域 |
| | | quyuPatchView.btnText2.Text = Intelligence.Automation.LogicMethod.GetGetRoomName(function); |
| | | }); |
| | | }; |
| | | |
| | | |
| | | //继续添加 |
| | | Button addBtn = new Button |
| | |
| | | #endregion |
| | | #region 界面点击事件 |
| | | //遥控器名称点击事件 |
| | | namePatchView.btnClick.MouseUpEventHandler += (sender, e) => { }; |
| | | namePatchView.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | |
| | | List<string> list = new List<string>(); |
| | | for (int i = 0; i < Pir.currPir.FunctioList.Count; i++) |
| | | { |
| | | list.Add(Pir.currPir.FunctioList[i].name); |
| | | } |
| | | Method method = new Method(); |
| | | method.EditControlName(StringId.editName, list, control.name, (name, dialog) => |
| | | { |
| | | Method.ThreadSend(new Control { deviceId = control.deviceId, name = name }, (responsePackNew) => |
| | | { |
| | | dialog.Close(); |
| | | namePatchView.btnText2.Text = name; |
| | | function.name = name; |
| | | |
| | | }, "修改名称", "dialog", null, dialog); |
| | | }, () => { }); |
| | | }; |
| | | //所属区域点击事件 |
| | | quyuPatchView.btnClick.MouseUpEventHandler += (sender, e) => { }; |
| | | quyuPatchView.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | Method method = new Method(); |
| | | method.ManagementPosition(function, () => |
| | | { |
| | | //更新区域 |
| | | quyuPatchView.btnText2.Text = Intelligence.Automation.LogicMethod.GetGetRoomName(function); |
| | | }); |
| | | }; |
| | | //继续添加点击事件 |
| | | addBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | |
| | | //完成点击事件 |
| | | saveView.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | //前面界面 |
| | | // this.RemoveFromParent(); |
| | | //移除所有界面 |
| | | MainPage.BasePageView.RemoveViewByTag("PirView"); |
| | | //主界面 |
| | | //移除红外宝根界面 |
| | | MainPage.BasePageView.RemoveViewByTag("PirMain"); |
| | | |
| | | //重新加载界面 |
| | | var page = new PirMain(); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.Show(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | |
| | | }; |
| | | #endregion |
| | | } |