| | |
| | | { |
| | | public class SoneLogicList : FrameLayout |
| | | { |
| | | /// <summary> |
| | | /// 给Sone门锁徐梅更新界面用的 |
| | | /// </summary> |
| | | public SoneLogicList() |
| | | { |
| | | Tag = "SoneLogic"; |
| | | } |
| | | public async void Show() |
| | | public async void Show(Action action = null, bool bool_If = false) |
| | | { |
| | | #region 界面的布局代码 |
| | | UserView.HomePage.Instance.ScrollEnabled = false;//锁住左滑 |
| | |
| | | view.clickBtn.MouseDownEventHandler += (sender, e) => |
| | | { |
| | | UserView.HomePage.Instance.ScrollEnabled = true; |
| | | if (action != null) |
| | | { |
| | | action(); |
| | | } |
| | | |
| | | RemoveFromParent(); |
| | | |
| | | }; |
| | | |
| | | var middle = new FrameLayout |
| | |
| | | SelectedImagePath = "ZigeeLogic/openMode.png", |
| | | }; |
| | | fLayout.AddChidren(modeIconBtn); |
| | | var logic = await SkipView.GetLogicIfon(); |
| | | if (logic != null) |
| | | { |
| | | |
| | | if (bool_If) |
| | | { |
| | | /// 查找是否存在时效性自动化;有的话就返回自动化对象; |
| | | var logic = await SkipView.GetLogicIfon(); |
| | | |
| | | fLayout.Height = Application.GetRealHeight(780);//改变高度 |
| | | modeIconBtn.IsSelected = true;//改变图标状态 |
| | |
| | | TextSize = 16, |
| | | }; |
| | | openModeFl.AddChidren(closeBtn); |
| | | closeBtn.MouseUpEventHandler += (sender,e) => { |
| | | |
| | | closeBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | |
| | | var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm, |
| | | Language.StringByID(MyInternationalizationString.doyouwanttodelete), |
| | | Language.StringByID(MyInternationalizationString.confrim));
|
| | | alert.Show();
|
| | | alert.ConfirmClickEvent += () =>
|
| | | alert.ConfirmClickEvent += async () =>
|
| | | { |
| | | Send.DelLogic(logic.LogicId); |
| | | |
| | | var bool_ = await UserCenter.DoorLock.DoorLockCommonInfo.DelNormallyOpenMode(new ZigBee.Device.DoorLock { }); |
| | | if (bool_) |
| | | { |
| | | |
| | | } |
| | | else { } |
| | | if (logic != null) |
| | | { |
| | | ///有可能只有常开模式,没有时效性自动化 |
| | | ///没有判断的话,逻辑会为空,抛出异常; |
| | | Send.DelLogic(logic.LogicId); |
| | | } |
| | | this.RemoveFromParent(); |
| | | var soneLogicList = new SoneLogicList(); |
| | | UserView.HomePage.Instance.AddChidren(soneLogicList); |
| | |
| | | }; |
| | | |
| | | ///显示失效设置时间文本控件 |
| | | var timeTextBtn= new Button |
| | | var timeTextBtn = new Button |
| | | { |
| | | Y = Application.GetRealHeight(127 + 69), |
| | | X = Application.GetRealWidth(225), |
| | |
| | | TextColor = ZigbeeColor.Current.LogicTextBlackColor, |
| | | Text = "时效性常开设置12:20", |
| | | }; |
| | | openModeFl.AddChidren(timeTextBtn); |
| | | if (logic != null) |
| | | { |
| | | ///有时效性常开才显示时间条件文本 |
| | | openModeFl.AddChidren(timeTextBtn); |
| | | } |
| | | ///时效性常开只有一个条件; |
| | | try |
| | | { |
| | | var y = DateTime.Now.ToString("yy");//那一年 |
| | | var m = DateTime.Now.ToString("mm");//那一月 |
| | | var d = DateTime.Now.ToString("dd");//那一天 |
| | | var h =int.Parse(DateTime.Now.ToString("HH"));//当前系统时间 |
| | | var h = int.Parse(DateTime.Now.ToString("HH"));//当前系统时间 |
| | | var me = DateTime.Now.ToLongDateString(); |
| | | var timeInt = int.Parse(logic.Conditions[0]["DoorLockOpenDelayTime"]); |
| | | int dayInt = (h + timeInt)/ 24;//算出几天后执行 |
| | | int dayInt = (h + timeInt) / 24;//算出几天后执行 |
| | | int hour = (h + timeInt) % 24;//算出几天后那个时间执行 |
| | | timeTextBtn.Text = "时效性常开设置" + y + "年" + m + "月" + d + dayInt + "号" + timeInt + "时"+ "执行"; |
| | | timeTextBtn.Text = "时效性常开设置" + y + "年" + m + "月" + d + dayInt + "号" + timeInt + "时" + "执行"; |
| | | } |
| | | catch { } |
| | | |
| | |
| | | TextSize = 15, |
| | | TextColor = ZigbeeColor.Current.LogicTextBlackColor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | // Text = "时效性常开设置", |
| | | TextID=MyInternationalizationString.timeSetSone, |
| | | // Text = "时效性常开设置", |
| | | TextID = MyInternationalizationString.timeSetSone, |
| | | }; |
| | | modeFl.AddChidren(modeTextBtn); |
| | | ///下一级菜单图标控件 |
| | |
| | | Height = Application.GetRealHeight(138), |
| | | Width = Application.GetRealWidth(1022), |
| | | }; |
| | | modeFl.AddChidren(clickBtn); |
| | | // modeFl.AddChidren(clickBtn); |
| | | |
| | | nextIconBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | Logic.LogicView.TipView tipView = new LogicView.TipView(); |
| | | |
| | | clickBtn.MouseUpEventHandler += async (sender, e) => |
| | | { |
| | | var d = await SkipView.LockAddModifyLogic(12, Send.CurrentDoorLock); |
| | | }; |
| | | FrameLayout fLayout1 = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicTranslucentColor }; |
| | | this.AddChidren(fLayout1); |
| | | tipView.ShowTip(fLayout1); |
| | | //string msg = Language.StringByID(R.MyInternationalizationString.SetDoorLockNomallyOpen).Replace("{0}", "\r\n"); |
| | | //var confirm = Language.StringByID(R.MyInternationalizationString.Confrim); |
| | | //var alert = new UserCenter.DoorLock.ShowDoorLockMsgControl(UserCenter.DoorLock.ShowDoorLockMsgControl.DoorLockMsgType.Confirm, msg, confirm); |
| | | //alert.Show(); |
| | | //alert.ConfirmClickEvent += () => |
| | | // { |
| | | // string msgTimeInValidSetting = Language.StringByID(R.MyInternationalizationString.DoorLockOpenAllTheTime); |
| | | // var timeConfrim = Language.StringByID(R.MyInternationalizationString.Confrim); |
| | | // var alertTimeInValidSetting = new UserCenter.DoorLock.ShowDoorLockMsgControl(UserCenter.DoorLock.ShowDoorLockMsgControl.DoorLockMsgType.InValid, msgTimeInValidSetting, timeConfrim); |
| | | // alertTimeInValidSetting.Show(); |
| | | // alertTimeInValidSetting.InvalidTimeAction += async (obj) => |
| | | // { |
| | | |
| | | // var result = await new ZigBee.Device.DoorLock { }.SetNormallyOpenModeFuncAsync(true); |
| | | // //var res = await Shared.Phone.Device.Logic.SkipView.LockAddModifyLogic(DoorLockCommonInfo.NormallyOpenModeInvalidTime, doorLock); |
| | | // }; |
| | | // }; |
| | | |
| | | // //UserCenter.DoorLock.DoorLockCommonInfo.NomallyOpenModeInvalidTimeDialog(new ZigBee.Device.DoorLock { }); |
| | | |
| | | //UserCenter.DoorLock.DoorLockCommonInfo.NomallyOpenModeStartDialog(new ZigBee.Device.DoorLock { }, () => |
| | | //{ |
| | | //}); |
| | | // var d = await SkipView.LockAddModifyLogic(12, Send.CurrentDoorLock); |
| | | |
| | | // var contr = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Tip, "sdgdgdfhfhfhgjggfg"); |
| | | //contr.Show(); |
| | | //contr.ConfirmClickEvent += () => |
| | | // { |
| | | // }; |
| | | |
| | | //UserCenter.DoorLock.DoorLockCommonInfo.NomallyOpenModeInvalidTimeDialog(); |
| | | }; |
| | | } |
| | | |
| | | #endregion |
| | |
| | | addLogicfL.AddChidren(addIconBtn); |
| | | addIconBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | |
| | | |
| | | //读取系统当前时间:时-分 |
| | | //读取系统当前时间:时-分 |
| | | var h = DateTime.Now.ToString("HH"); |