| | |
| | | Height = Application.GetRealHeight(69), |
| | | Y = Application.GetRealHeight(92), |
| | | TextID = MyInternationalizationString.selection, |
| | | IsBold = true, |
| | | }; |
| | | topRowLayout.AddChidren(titleName); |
| | | if (Common.Logic.CurrentLogic.LogicId != 0) |
| | |
| | | Height = Application.GetRealHeight(436), |
| | | X = Application.GetRealWidth(72), |
| | | Y = Application.GetRealHeight(30), |
| | | UnSelectedImagePath = "ZigeeLogic/logicbj" + s + ".png", |
| | | UnSelectedImagePath = $"ZigeeLogic/logicbj{s}.png", |
| | | }; |
| | | logiciconfl.AddChidren(iconBtn); |
| | | |
| | |
| | | logicTextBox = new EditText |
| | | { |
| | | Y = Application.GetRealHeight(35), |
| | | Width = Application.GetRealWidth(900), |
| | | Width = Application.GetRealWidth(1080 - 58 - 300), |
| | | Height = Application.GetRealHeight(60), |
| | | X = text.Right, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | |
| | | var addtextbtn = new Button |
| | | { |
| | | Height = Application.GetRealHeight(58), |
| | | Width = Application.GetRealWidth(300), |
| | | Width = Application.GetRealWidth(400), |
| | | Y = Application.GetRealHeight(45 + 30), |
| | | TextColor = ZigbeeColor.Current.LogicBlankBackgroundColor, |
| | | TextID = MyInternationalizationString.addconditions, |
| | | X = Application.GetRealWidth(390), |
| | | TextID = MyInternationalizationString.addsensor, |
| | | X = Application.GetRealWidth(340), |
| | | TextSize = 14, |
| | | }; |
| | | addfl.AddChidren(addtextbtn); |
| | |
| | | { |
| | | int minute = int.Parse(conditions["IgnoreTime"]) / 60; |
| | | int second = int.Parse(conditions["IgnoreTime"]) % 60; |
| | | if (second != 0) |
| | | if (minute != 0 && second != 0) |
| | | { |
| | | devicestatus.Text = minute.ToString() + Language.StringByID(MyInternationalizationString.minute) + second.ToString() + Language.StringByID(MyInternationalizationString.second) + Language.StringByID(MyInternationalizationString.unattendedtime1); |
| | | |
| | | } |
| | | else |
| | | { |
| | | devicestatus.Text = minute.ToString() + Language.StringByID(MyInternationalizationString.Minute) + Language.StringByID(MyInternationalizationString.unattendedtime1); |
| | | if (minute == 0 && second != 0) |
| | | { |
| | | devicestatus.Text = second.ToString() + Language.StringByID(MyInternationalizationString.second) + Language.StringByID(MyInternationalizationString.unattendedtime1); |
| | | |
| | | } |
| | | if (minute != 0 && second == 0) |
| | | { |
| | | devicestatus.Text = minute.ToString() + Language.StringByID(MyInternationalizationString.Minute) + Language.StringByID(MyInternationalizationString.unattendedtime1); |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | 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 templatePage = new TemplatePage(); |
| | | UserView.HomePage.Instance.AddChidren(templatePage); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | templatePage.Show(); |
| | | } |
| | | }; |
| | | var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm, |
| | | Language.StringByID(MyInternationalizationString.doyouwanttodelete), |
| | | Language.StringByID(MyInternationalizationString.confrim)); |
| | | alert.Show(); |
| | | alert.ConfirmClickEvent += () => |
| | | { |
| | | Common.Logic.CurrentLogic.Conditions.Remove(conditions); |
| | | var templatePage = new TemplatePage(); |
| | | UserView.HomePage.Instance.AddChidren(templatePage); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | templatePage.Show(); |
| | | }; |
| | | |
| | | }; |
| | | |
| | |
| | | var addtextbtn = new Button |
| | | { |
| | | Height = Application.GetRealHeight(58), |
| | | Width = Application.GetRealWidth(300), |
| | | Width = Application.GetRealWidth(400), |
| | | Y = Application.GetRealHeight(45 + 30), |
| | | TextColor = ZigbeeColor.Current.LogicBlankBackgroundColor, |
| | | TextID = MyInternationalizationString.addfunction, |
| | | X = Application.GetRealWidth(390), |
| | | TextID = MyInternationalizationString.addlighting, |
| | | X = Application.GetRealWidth(340), |
| | | TextSize = 14, |
| | | }; |
| | | addfl.AddChidren(addtextbtn); |
| | |
| | | |
| | | 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.Actions.Remove(actions); |
| | | var templatePage = new TemplatePage(); |
| | | UserView.HomePage.Instance.AddChidren(templatePage); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | templatePage.Show(); |
| | | } |
| | | }; |
| | | |
| | | var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm, |
| | | Language.StringByID(MyInternationalizationString.doyouwanttodelete), |
| | | Language.StringByID(MyInternationalizationString.confrim)); |
| | | alert.Show(); |
| | | alert.ConfirmClickEvent += () => |
| | | { |
| | | Common.Logic.CurrentLogic.Actions.Remove(actions); |
| | | var templatePage = new TemplatePage(); |
| | | UserView.HomePage.Instance.AddChidren(templatePage); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | templatePage.Show(); |
| | | }; |
| | | |
| | | }; |
| | | |
| | |
| | | Gravity = Gravity.CenterVertical, |
| | | }; |
| | | pushswitchRowlayout.AddChidren(btnswitch); |
| | | btnswitch.MouseUpEventHandler += (sender1, e1) => |
| | | { |
| | | btnswitch.IsSelected = !btnswitch.IsSelected; |
| | | if (btnswitch.IsSelected) |
| | | { |
| | | |
| | | } |
| | | else |
| | | { |
| | | |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | var custompushFrameLayout = new FrameLayout |
| | | { |
| | | Height = Application.GetRealHeight(160), |
| | | Height = Application.GetRealHeight(0), |
| | | BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor, |
| | | }; |
| | | middle.AddChidren(custompushFrameLayout); |
| | |
| | | |
| | | #endregion |
| | | |
| | | bool tag = false;//标记开关状态; |
| | | btnswitch.MouseUpEventHandler += (sender1, e1) => |
| | | { |
| | | btnswitch.IsSelected = !btnswitch.IsSelected; |
| | | if (btnswitch.IsSelected) |
| | | { |
| | | tag = true; |
| | | custompushFrameLayout.Height = Application.GetRealHeight(160); |
| | | Common.Logic.CurrentLogic.LogicIsCustomPushText = 1; |
| | | if (Common.Logic.CurrentLogic.LogicId != 0) |
| | | { |
| | | Send.Data("添加/更新", "/App/HomeLogicConfig", "POST"); |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | tag = false; |
| | | custompushFrameLayout.Height = Application.GetRealHeight(0); |
| | | Common.Logic.CurrentLogic.LogicIsCustomPushText = 0; |
| | | if (Common.Logic.CurrentLogic.LogicId != 0) |
| | | { |
| | | Send.Data("删除", "/App/DelHomeLogicConfig", "POST"); |
| | | } |
| | | |
| | | } |
| | | }; |
| | | if (Common.Logic.CurrentLogic.LogicIsCustomPushText == 0) |
| | | { |
| | | btnswitch.IsSelected = false; |
| | | } |
| | | else |
| | | { |
| | | btnswitch.IsSelected = true; |
| | | } |
| | | var saveFrameLayout = new FrameLayout |
| | | { |
| | | Y = middle.Bottom, |
| | |
| | | Width = Application.GetRealWidth(910), |
| | | Radius = (uint)Application.GetRealHeight(60), |
| | | BackgroundColor = ZigbeeColor.Current.LogicBtnSaveBackgroundColor, |
| | | TextID = MyInternationalizationString.Save, |
| | | TextID = MyInternationalizationString.application, |
| | | TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor, |
| | | }; |
| | | saveFrameLayout.AddChidren(btnsave); |
| | |
| | | //} |
| | | if (string.IsNullOrEmpty(logicTextBox.Text.Trim())) |
| | | { |
| | | new Alert(Language.StringByID(MyInternationalizationString.Tip), Language.StringByID(MyInternationalizationString.PleaseEnterLogicName), Language.StringByID(MyInternationalizationString.Close)).Show(); |
| | | var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal, |
| | | Language.StringByID(MyInternationalizationString.PleaseEnterLogicName), |
| | | Language.StringByID(MyInternationalizationString.confrim)); |
| | | alert.Show(); |
| | | return; |
| | | } |
| | | var logicname = Common.Logic.LogicList.Find((logic) => Common.Logic.CurrentLogic.LogicId != logic.LogicId && logic.LogicName == name); |
| | | if (logicname != null) |
| | | { |
| | | new Alert(Language.StringByID(MyInternationalizationString.Tip), Language.StringByID(MyInternationalizationString.Rename), Language.StringByID(MyInternationalizationString.Close)).Show(); |
| | | return; |
| | | } |
| | | //var logicname = Common.Logic.LogicList.Find((logic) => Common.Logic.CurrentLogic.LogicId != logic.LogicId && logic.LogicName == name); |
| | | //if (logicname != null) |
| | | //{ |
| | | // new Alert(Language.StringByID(MyInternationalizationString.Tip), Language.StringByID(MyInternationalizationString.Rename), Language.StringByID(MyInternationalizationString.Close)).Show(); |
| | | // return; |
| | | //} |
| | | |
| | | Common.Logic.CurrentLogic.LogicName = name; |
| | | |
| | |
| | | { |
| | | Common.Logic.CurrentLogic.LogicId = logicifon.LogicId; |
| | | Common.Logic.LogicList.Add(Common.Logic.CurrentLogic); |
| | | if (tag) |
| | | { |
| | | Send.Data("添加/更新", "/App/HomeLogicConfig", "POST"); |
| | | } |
| | | } |
| | | } |
| | | else |