| | |
| | | |
| | | var titleName = new Button |
| | | { |
| | | TextSize = 16, |
| | | TextSize = 17, |
| | | TextColor = ZigbeeColor.Current.LogicTextBlackColor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | X = Application.GetRealWidth(176), |
| | | Width = Application.GetRealWidth(400), |
| | | Width = Application.GetRealWidth(600), |
| | | Height = Application.GetRealHeight(69), |
| | | Y = Application.GetRealHeight(92), |
| | | TextID = MyInternationalizationString.selection, |
| | |
| | | TextID = MyInternationalizationString.automationname, |
| | | TextColor = ZigbeeColor.Current.LogicTextBlackColor, |
| | | Y = Application.GetRealHeight(35), |
| | | TextSize = 15, |
| | | }; |
| | | logicnamefl.AddChidren(text); |
| | | |
| | |
| | | X = text.Right, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = ZigbeeColor.Current.LogicBtnCancelColor, |
| | | TextSize = 13, |
| | | TextSize = 14, |
| | | Text = Common.Logic.CurrentLogic.LogicName, |
| | | //TextID=MyInternationalizationString.automation1, |
| | | }; |
| | |
| | | TextColor = ZigbeeColor.Current.LogicTextBlackColor, |
| | | Width = Application.GetRealWidth(300), |
| | | Height = Application.GetRealHeight(60), |
| | | TextSize = 16, |
| | | TextSize = 15, |
| | | Gravity = Gravity.CenterVertical, |
| | | }); |
| | | |
| | |
| | | ///添加条件的点击事件 |
| | | 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; |
| | |
| | | var addtextbtn = new Button |
| | | { |
| | | Height = Application.GetRealHeight(58), |
| | | Width = Application.GetRealWidth(300), |
| | | Width = Application.GetRealWidth(500), |
| | | 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; |
| | |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = deviceinof.DeviceEpointName, |
| | | TextColor = ZigbeeColor.Current.LogicTextBlackColor, |
| | | TextSize = 14, |
| | | }; |
| | | conditionsRowLayout.AddChidren(btndevice); |
| | | |
| | |
| | | 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); |
| | | }; |
| | | |
| | | ///显示设备条件状态控件 |
| | |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | X = Application.GetRealWidth(400), |
| | | TextColor = ZigbeeColor.Current.LogicBtnCancelColor, |
| | | TextSize = 14, |
| | | }; |
| | | conditionsRowLayout.AddChidren(devicestatus); |
| | | |
| | |
| | | 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 = conditions["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) => |
| | | { |
| | | if (e1) |
| | | { |
| | | Common.Logic.CurrentLogic.Conditions.Remove(conditions); |
| | | var lockLogicCommunalPage = new LockLogicCommunalPage(); |
| | | UserView.HomePage.Instance.AddChidren(lockLogicCommunalPage); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | |
| | | TextColor = ZigbeeColor.Current.LogicTextBlackColor, |
| | | Width = Application.GetRealWidth(300), |
| | | Height = Application.GetRealHeight(60), |
| | | TextSize = 16, |
| | | TextSize = 15, |
| | | Gravity = Gravity.CenterVertical, |
| | | }; |
| | | targetRowLayout.AddChidren(btntargettitle); |
| | |
| | | TextColor = ZigbeeColor.Current.LogicBlankBackgroundColor, |
| | | TextID = MyInternationalizationString.lockaddaction, |
| | | X = Application.GetRealWidth(390), |
| | | TextSize = 14, |
| | | }; |
| | | addfl.AddChidren(addtextbtn); |
| | | EventHandler<MouseEventArgs> addfunctionclick = (sender, e) => |
| | |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = deviceinof.DeviceEpointName, |
| | | TextColor = ZigbeeColor.Current.LogicTextBlackColor, |
| | | TextSize = 14, |
| | | }; |
| | | actionsrowLayout.AddChidren(btndevicename); |
| | | |
| | |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | X = Application.GetRealWidth(450), |
| | | TextColor = ZigbeeColor.Current.LogicBtnCancelColor, |
| | | TextSize = 14, |
| | | }; |
| | | actionsrowLayout.AddChidren(devicestatus); |
| | | |
| | |
| | | ///编辑点击事件 |
| | | deviceedit.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | |
| | | |
| | | var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor }; |
| | | this.AddChidren(flMain); |
| | | LockAddDevice.CurrentDeviceStateView(flMain, deviceinof, true); |
| | |
| | | // devicestatus.Text = Language.StringByID(MyInternationalizationString.close); |
| | | |
| | | ifclose = false; |
| | | break; |
| | | } |
| | | else if (status["Data1"].ToString() == "1") |
| | | { |
| | |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = sceneinof.Name, |
| | | TextColor = ZigbeeColor.Current.LogicTextBlackColor, |
| | | TextSize = 14, |
| | | }; |
| | | actionsrowLayout.AddChidren(btndevicename); |
| | | |
| | |
| | | if (e1) |
| | | { |
| | | Common.Logic.CurrentLogic.Actions.Remove(actions); |
| | | } |
| | | var lockLogicCommunalPage = new LockLogicCommunalPage(); |
| | | UserView.HomePage.Instance.AddChidren(lockLogicCommunalPage); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | lockLogicCommunalPage.Show(() => { }); |
| | | } |
| | | }; |
| | | alert.Show(); |
| | | |
| | |
| | | Height = Application.GetRealHeight(60), |
| | | Gravity = Gravity.CenterVertical, |
| | | TextID = MyInternationalizationString.pushswitch, |
| | | TextSize = 14, |
| | | }; |
| | | pushswitchRowlayout.AddChidren(btnswitchtxet); |
| | | |
| | |
| | | Width = Application.GetRealWidth(300), |
| | | Height = Application.GetRealHeight(60), |
| | | Gravity = Gravity.CenterVertical, |
| | | TextSize = 14, |
| | | }; |
| | | custompushRowLayout.AddChidren(btncustompush); |
| | | |
| | |
| | | BackgroundColor = ZigbeeColor.Current.LogicBtnSaveBackgroundColor, |
| | | TextID = MyInternationalizationString.Save, |
| | | TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor, |
| | | TextSize = 16, |
| | | }; |
| | | saveFrameLayout.AddChidren(btnsave); |
| | | btnsave.MouseUpEventHandler += async (sender, e) => |
| | |
| | | }; |
| | | |
| | | } |
| | | public void AddCondition(int value) |
| | | { |
| | | var addCondition = new AddCondition(); |
| | | addCondition.conditionsIndex = value; |
| | | UserView.HomePage.Instance.AddChidren(addCondition); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | addCondition.Show(); |
| | | |
| | | } |
| | | } |
| | | } |