| | |
| | | { |
| | | Tag = "PirView"; |
| | | } |
| | | public void Show() |
| | | public void Show(Action action) |
| | | { |
| | | #region 界面布局 |
| | | this.BackgroundColor = CSS.CSS_Color.viewMiddle; |
| | |
| | | topView.topNameBtn.TextID = StringId.shebeigaunli; |
| | | topView.topIconBtn.Visible = true; |
| | | this.AddChidren(topView.FLayoutView()); |
| | | topView.clickBackBtn.MouseUpEventHandler += (sender, e) => { this.RemoveFromParent(); }; |
| | | topView.clickBackBtn.MouseUpEventHandler += (sender, e) => { |
| | | action(); |
| | | this.RemoveFromParent(); |
| | | }; |
| | | VerticalRefreshLayout vv = new VerticalRefreshLayout(); |
| | | vv.Height = Application.GetRealHeight(667 - 64); |
| | | vv.Y = Application.GetRealHeight(64); |
| | |
| | | Width = Application.GetRealWidth(8), |
| | | Height = Application.GetRealWidth(8), |
| | | UnSelectedImagePath = "PirIcon/online.png", |
| | | SelectedImagePath = "PirIcon/offline.png", |
| | | }; |
| | | devfLayout.AddChidren(stateIconBtn); |
| | | //红外宝状态(在线-离线) |
| | |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = TextSize.text12, |
| | | TextColor = 0xFF67D569,// CSS.CSS_Color.textColor, |
| | | SelectedTextColor =CSS.CSS_Color.textRedColor, |
| | | IsBold = true, |
| | | }; |
| | | devfLayout.AddChidren(stateTextBtn); |
| | | if (pirDevice.online) { |
| | | stateIconBtn.IsSelected = true; |
| | | stateTextBtn.IsSelected = true; |
| | | } else { |
| | | stateIconBtn.IsSelected = false; |
| | | stateTextBtn.IsSelected = false; |
| | | } |
| | | //线 |
| | | Button lineBtn = new Button |
| | | { |
| | |
| | | X = Application.GetRealWidth(311 + 16 - (40 + 100)), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealHeight(17), |
| | | Text = j.ToString(), |
| | | Text = Intelligence.Automation.LogicMethod.GetGetRoomName(control), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextSize = TextSize.text12, |
| | | TextColor = CSS.CSS_Color.textCancelColor, |
| | |
| | | { |
| | | if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "") |
| | | { |
| | | pirDevice.FunctioList.Remove(Function); |
| | | var function = pirDevice.FunctioList.Find((c)=>c.sid== Function.sid); |
| | | if (function != null) |
| | | { |
| | | pirDevice.FunctioList.Remove(Function); |
| | | if (Pir.currPir != null && pirDevice.sid == Pir.currPir.sid) |
| | | { |
| | | Pir.currPir.FunctioList = pirDevice.FunctioList; |
| | | } |
| | | } |
| | | UIView(vv); |
| | | } |
| | | |
| | |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | EventHandler<MouseEventArgs> editClick = (sender, e) => |
| | | { |
| | | EditControl editControl = new EditControl(); |
| | | MainPage.BasePageView.AddChidren(editControl); |
| | | editControl.Show(control, pirDevice, (device) => |
| | | { |
| | | //回调更新名字/区域 |
| | | nameBtn.Text = device.name; |
| | | areaBtn.Text = Intelligence.Automation.LogicMethod.GetGetRoomName(device); |
| | | |
| | | }); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | funControlRow.MouseUpEventHandler += editClick; |
| | | nameBtn.MouseUpEventHandler += editClick; |
| | | areaBtn.MouseUpEventHandler += editClick; |
| | | nextIconBtn.MouseUpEventHandler += editClick; |
| | | } |
| | | |
| | | |
| | |
| | | { |
| | | list.Add(Pir.pirDeviceList[b].name); |
| | | } |
| | | TipPopView tipPopView = new TipPopView(); |
| | | tipPopView.InputBox(StringId.xiugaimingzi, pirclick.name, StringId.nameNull, StringId.NameAlreadyExists, list, (name, view) => |
| | | Method methodView = new Method(); |
| | | methodView.EditControlName(StringId.xiugaimingzi, list, pirclick.name, (name, view) => |
| | | { |
| | | pirclick.name = name; |
| | | //加载log |
| | |
| | | { |
| | | try |
| | | { |
| | | responsePackNew = PirSend.DeviceRename(pirclick); |
| | | responsePackNew = PirSend.DeviceRename(pirclick.deviceId, pirclick.name); |
| | | } |
| | | catch { } |
| | | finally |
| | |
| | | |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | }, () => |
| | | { |
| | | },()=> { |
| | | NewSwitchView(pirclick, vv); |
| | | }, false); |
| | | },false); |
| | | |
| | | } |
| | | else |