| | |
| | | ///添加条件的点击事件 |
| | | EventHandler<MouseEventArgs> conditionaddclick = (sender, e) => |
| | | { |
| | | var addCondition = new AddCondition(); |
| | | addCondition.conditionsIndex = -1; |
| | | UserView.HomePage.Instance.AddChidren(addCondition); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | addCondition.Show(); |
| | | AddCondition(-1); |
| | | }; |
| | | conditionadd.MouseUpEventHandler += conditionaddclick; |
| | | conditionadd1.MouseUpEventHandler += conditionaddclick; |
| | |
| | | Y = Application.GetRealHeight(45 + 30), |
| | | TextColor = ZigbeeColor.Current.LogicBlankBackgroundColor, |
| | | TextID = MyInternationalizationString.selectunlockingmode, |
| | | X = Application.GetRealWidth(390), |
| | | X = Application.GetRealWidth(290), |
| | | TextSize = 14, |
| | | }; |
| | | addfl.AddChidren(addtextbtn); |
| | | |
| | | EventHandler<MouseEventArgs> addconditionsclick = (sender, e) => |
| | | { |
| | | var addCondition = new AddCondition(); |
| | | ///记录索引 |
| | | addCondition.conditionsIndex = -1; |
| | | UserView.HomePage.Instance.AddChidren(addCondition); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | addCondition.Show(); |
| | | AddCondition(-1); |
| | | }; |
| | | addbtn.MouseUpEventHandler += addconditionsclick; |
| | | addtextbtn.MouseUpEventHandler += addconditionsclick; |
| | |
| | | BackgroundColor = ZigbeeColor.Current.LogicEditBlackColor1, |
| | | Text = Language.StringByID(MyInternationalizationString.edit), |
| | | TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor, |
| | | Tag=i, |
| | | Tag = i, |
| | | }; |
| | | conditionsRowLayout.AddRightView(deviceedit); |
| | | deviceedit.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | var addCondition = new AddCondition(); |
| | | ///记录索引 |
| | | addCondition.conditionsIndex = int.Parse(deviceedit.Tag.ToString()); |
| | | UserView.HomePage.Instance.AddChidren(addCondition); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | addCondition.Show(); |
| | | |
| | | int intvalue = int.Parse(deviceedit.Tag.ToString()); |
| | | AddCondition(intvalue); |
| | | }; |
| | | |
| | | ///显示设备条件状态控件 |
| | |
| | | case DeviceType.DoorLock: |
| | | { |
| | | conditionIcon.UnSelectedImagePath = "ZigeeLogic/doorlock.png"; |
| | | //for (int a = 0; a < Common.Logic.CurrentLogic.Accounts.Count; a++) |
| | | //{ |
| | | // if (Common.Logic.CurrentLogic.Accounts[a]["Type"] == "1") |
| | | // { |
| | | // if (Common.Logic.CurrentLogic.Accounts[a]["UserId"] == conditions["AttriButeData2"]) |
| | | // { |
| | | // devicestatus.Text = Common.Logic.CurrentLogic.Accounts["Account"]; |
| | | // break; |
| | | // } |
| | | // } |
| | | //} |
| | | |
| | | //(0按键/3卡/15指纹) |
| | | switch (conditions["AttriButeId"]) |
| | | for (int a = 0; a < Common.Logic.CurrentLogic.Accounts.Count; a++) |
| | | { |
| | | case "0": |
| | | if (Common.Logic.CurrentLogic.Accounts[a]["Type"] == "1") |
| | | { |
| | | if (Common.Logic.CurrentLogic.Accounts[a]["UserId"] == conditions["AttriButeData2"]) |
| | | { |
| | | devicestatus.Text = Language.StringByID(MyInternationalizationString.lockpassword); |
| | | devicestatus.Text = Common.Logic.CurrentLogic.Accounts[a]["Account"]; |
| | | break; |
| | | } |
| | | break; |
| | | case "3": |
| | | { |
| | | devicestatus.Text = Language.StringByID(MyInternationalizationString.ic); |
| | | } |
| | | break; |
| | | case "15": |
| | | { |
| | | devicestatus.Text = Language.StringByID(MyInternationalizationString.fingerprint); |
| | | } |
| | | break; |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | break; |
| | | } |
| | |
| | | Text = Language.StringByID(MyInternationalizationString.del), |
| | | }; |
| | | conditionsRowLayout.AddRightView(del); |
| | | |
| | | del.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | |
| | | var alert = new Alert(Language.StringByID(MyInternationalizationString.tip), Language.StringByID(MyInternationalizationString.doyouwanttodelete), |
| | | Language.StringByID(MyInternationalizationString.cancel), Language.StringByID(MyInternationalizationString.confrim)); |
| | | alert.ResultEventHandler += (sender1, e1) => |
| | |
| | | ///编辑点击事件 |
| | | deviceedit.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | |
| | | |
| | | var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor }; |
| | | this.AddChidren(flMain); |
| | | LockAddDevice.CurrentDeviceStateView(flMain, deviceinof, true); |
| | |
| | | }; |
| | | |
| | | } |
| | | public void AddCondition(int value) |
| | | { |
| | | var addCondition = new AddCondition(); |
| | | addCondition.conditionsIndex = value; |
| | | UserView.HomePage.Instance.AddChidren(addCondition); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | addCondition.Show(); |
| | | |
| | | } |
| | | } |
| | | } |