| | |
| | | #endregion |
| | | #region 界面点击事件 |
| | | //遥控器名称点击事件 |
| | | namePatchView.btnClick.MouseUpEventHandler += (sender, e) => { |
| | | namePatchView.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | |
| | | List<string> list = new List<string>(); |
| | | |
| | | for (int i = 0; i < PirDevice.Pir.currPir.FunctioList.Count; i++) |
| | | for (int i = 0; i < Pir.currPir.FunctioList.Count; i++) |
| | | { |
| | | list.Add(PirDevice.Pir.currPir.FunctioList[i].name); |
| | | list.Add(Pir.currPir.FunctioList[i].name); |
| | | } |
| | | Method method = new Method(); |
| | | method.EditControlName(StringId.editName, list, control.name, (name, view) => |
| | | method.EditControlName(StringId.editName, list, control.name, (name, dialog) => |
| | | { |
| | | //加载log |
| | | Loading loading = new Loading(); |
| | | view.AddChidren(loading); |
| | | HDL_ON.DAL.Server.ResponsePackNew responsePackNew = null; |
| | | loading.Start(); |
| | | new System.Threading.Thread(() => |
| | | Method.ThreadSend(new Control { deviceId = control.deviceId, name = name }, (responsePackNew) => |
| | | { |
| | | 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, ""); |
| | | } |
| | | dialog.Close(); |
| | | namePatchView.btnText2.Text = name; |
| | | function.name = name; |
| | | |
| | | }); |
| | | } |
| | | |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | |
| | | }, "修改名称", "dialog", null, dialog); |
| | | }, () => { }); |
| | | }; |
| | | //所属区域点击事件 |
| | |
| | | //完成点击事件 |
| | | saveView.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | //前面界面 |
| | | // this.RemoveFromParent(); |
| | | //移除所有界面 |
| | | MainPage.BasePageView.RemoveViewByTag("PirView"); |
| | | //主界面 |
| | | //MainPage.BasePageView.RemoveViewByTag("PirMain"); |
| | | |
| | | //移除红外宝根界面 |
| | | MainPage.BasePageView.RemoveViewByTag("PirMain"); |
| | | //重新加载界面 |
| | | var page = new PirMain(); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.Show(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | |
| | | }; |
| | | #endregion |
| | | } |