| | |
| | | ZigBee.Device.ZbGateway.StatusList.Add(this); |
| | | } |
| | | |
| | | #region ◆ 变量申明__________________________ |
| | | #region 变量申明 |
| | | /// <summary> |
| | | /// 当前门锁 |
| | | /// </summary> |
| | | ZigBee.Device.DoorLock doorLock; |
| | | public System.Collections.Generic.List<Button> pawButtonList = new System.Collections.Generic.List<Button> { };//临时密码中的6位数字 |
| | | Button passwordText; //临时密码 |
| | | /// <summary> |
| | | /// 临时密码中的6位数字 |
| | | /// </summary> |
| | | public System.Collections.Generic.List<Button> pawButtonList = new System.Collections.Generic.List<Button> { }; |
| | | /// <summary> |
| | | /// 临时密码 |
| | | /// </summary> |
| | | Button passwordText; |
| | | /// <summary> |
| | | /// 中部布的顶部布局 |
| | | /// </summary> |
| | | FrameLayout MidTopFrameLayout; |
| | | Action<string, string> action;//接收通知 |
| | | /// <summary> |
| | | /// 接收通知 |
| | | /// </summary> |
| | | Action<string, string> action; |
| | | /// <summary> |
| | | /// 保存完成按钮 |
| | | /// </summary> |
| | | Button btnFinifh; |
| | | /// <summary> |
| | | /// 当前有效日期时间 |
| | | /// </summary> |
| | | DateTime cunVDateTime; |
| | | /// <summary> |
| | | /// 当前失效日期时间 |
| | | /// </summary> |
| | | DateTime cunIVDateTime; |
| | | #endregion |
| | | |
| | |
| | | |
| | | EventHandler<MouseEventArgs> eHandler = (sender, e) => |
| | | { |
| | | var dialog = new Dialog { }; |
| | | dialog.Show(); |
| | | |
| | | var flMain = new FrameLayout { BackgroundColor = 0x00000000 }; |
| | | dialog.AddChidren(flMain); |
| | | flMain.MouseUpEventHandler += (sender11, e11) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | |
| | | var delBackgroundFrameLayout = new FrameLayout |
| | | { |
| | | X = Application.GetRealWidth(596), |
| | | Y = Application.GetRealHeight(164), |
| | | Height = Application.GetRealHeight(173), |
| | | Width = Application.GetRealWidth(449), |
| | | BackgroundImagePath = "DoorLock/DelBackground.png", |
| | | }; |
| | | flMain.AddChidren(delBackgroundFrameLayout); |
| | | |
| | | var btnDelIcon2 = new Button |
| | | { |
| | | Height = Application.GetRealHeight(81), |
| | | Width = Application.GetRealWidth(81), |
| | | X = Application.GetRealWidth(81), |
| | | Y = Application.GetRealHeight(55), |
| | | UnSelectedImagePath = "DoorLock/DelIcon.png", |
| | | }; |
| | | delBackgroundFrameLayout.AddChidren(btnDelIcon2); |
| | | |
| | | var btnDelText = new Button |
| | | { |
| | | Height = Application.GetRealHeight(58), |
| | | Width = Application.GetRealWidth(311), |
| | | X = Application.GetRealWidth(173), |
| | | Y = Application.GetRealHeight(69), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = Language.StringByID(R.MyInternationalizationString.ClearTempPassword), |
| | | TextColor = Shared.Common.ZigbeeColor.Current.XMTopTitleText, |
| | | TextSize = 14, |
| | | IsBold = true, |
| | | }; |
| | | delBackgroundFrameLayout.AddChidren(btnDelText); |
| | | |
| | | EventHandler<MouseEventArgs> eHandler2 = (sender2, e2) => |
| | | { |
| | | dialog.Close(); |
| | | string msg = Language.StringByID(R.MyInternationalizationString.SureToDeleteTempPassword); |
| | | var alert = new Shared.Phone.UserCenter.ShowMsgControl(ShowMsgType.Confirm, msg, Language.StringByID(R.MyInternationalizationString.DoorlockConfirm)); |
| | | alert.Show(); |
| | | //使用确认型弹框时,的回调函数 |
| | | alert.ConfirmClickEvent += () => |
| | | { |
| | | ClearEventHandler(btnDelText); |
| | | }; |
| | | }; |
| | | delBackgroundFrameLayout.MouseDownEventHandler += eHandler2; |
| | | btnDelIcon2.MouseDownEventHandler += eHandler2; |
| | | btnDelText.MouseDownEventHandler += eHandler2; |
| | | ClearDialog(); |
| | | }; |
| | | btnDelFrameLayout.MouseDownEventHandler += eHandler; |
| | | btnDelIcon.MouseDownEventHandler += eHandler; |
| | |
| | | MidFrameLayoutContent(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 中部布局 |
| | | /// </summary> |
| | | public void MidFrameLayoutContent() |
| | | { |
| | | MidTopFrameLayout.RemoveAll(); |
| | |
| | | }; |
| | | #endregion |
| | | } |
| | | //底部界面和数据处理 |
| | | /// <summary> |
| | | /// 底部布局处理 |
| | | /// </summary> |
| | | public void BottomFrameLayoutContent() |
| | | { |
| | | var bottomFrameLayout = new FrameLayout() |
| | |
| | | var btnLine = new FrameLayout() |
| | | { |
| | | Width = Application.GetRealWidth(965), |
| | | Height = Application.GetRealHeight(5), |
| | | Height = 1, |
| | | X = Application.GetRealWidth(58), |
| | | BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine, |
| | | }; |
| | |
| | | }; |
| | | } |
| | | |
| | | //确定事件处理 |
| | | /// <summary> |
| | | /// 确定事件处理 |
| | | /// </summary> |
| | | /// <param name="btnFinifh"></param> |
| | | void FinifhEventHandler(Button btnFinifh) |
| | | { |
| | | System.Threading.Tasks.Task.Run(async () => |
| | |
| | | }); |
| | | } |
| | | |
| | | //清除事件处理 |
| | | /// <summary> |
| | | /// 清除UI |
| | | /// </summary> |
| | | void ClearDialog() |
| | | { |
| | | var dialog = new Dialog { }; |
| | | dialog.Show(); |
| | | |
| | | var flMain = new FrameLayout { BackgroundColor = 0x00000000 }; |
| | | dialog.AddChidren(flMain); |
| | | flMain.MouseUpEventHandler += (sender11, e11) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | |
| | | var delBackgroundFrameLayout = new FrameLayout |
| | | { |
| | | X = Application.GetRealWidth(596), |
| | | Y = Application.GetRealHeight(164), |
| | | Height = Application.GetRealHeight(173), |
| | | Width = Application.GetRealWidth(449), |
| | | BackgroundImagePath = "DoorLock/DelBackground.png", |
| | | }; |
| | | flMain.AddChidren(delBackgroundFrameLayout); |
| | | |
| | | var btnDelIcon2 = new Button |
| | | { |
| | | Height = Application.GetRealHeight(81), |
| | | Width = Application.GetRealWidth(81), |
| | | X = Application.GetRealWidth(81), |
| | | Y = Application.GetRealHeight(55), |
| | | UnSelectedImagePath = "DoorLock/DelIcon.png", |
| | | }; |
| | | delBackgroundFrameLayout.AddChidren(btnDelIcon2); |
| | | |
| | | var btnDelText = new Button |
| | | { |
| | | Height = Application.GetRealHeight(58), |
| | | Width = Application.GetRealWidth(311), |
| | | X = Application.GetRealWidth(173), |
| | | Y = Application.GetRealHeight(69), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = Language.StringByID(R.MyInternationalizationString.ClearTempPassword), |
| | | TextColor = Shared.Common.ZigbeeColor.Current.XMTopTitleText, |
| | | TextSize = 14, |
| | | IsBold = true, |
| | | }; |
| | | delBackgroundFrameLayout.AddChidren(btnDelText); |
| | | |
| | | EventHandler<MouseEventArgs> eHandler2 = (sender2, e2) => |
| | | { |
| | | dialog.Close(); |
| | | string msg = Language.StringByID(R.MyInternationalizationString.SureToDeleteTempPassword); |
| | | var alert = new Shared.Phone.UserCenter.ShowMsgControl(ShowMsgType.Confirm, msg, Language.StringByID(R.MyInternationalizationString.DoorlockConfirm)); |
| | | alert.Show(); |
| | | //使用确认型弹框时,的回调函数 |
| | | alert.ConfirmClickEvent += () => |
| | | { |
| | | ClearEventHandler(btnDelText); |
| | | }; |
| | | }; |
| | | delBackgroundFrameLayout.MouseDownEventHandler += eHandler2; |
| | | btnDelIcon2.MouseDownEventHandler += eHandler2; |
| | | btnDelText.MouseDownEventHandler += eHandler2; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 清除事件处理 |
| | | /// </summary> |
| | | /// <param name="btnDelText"></param> |
| | | async void ClearEventHandler(Button btnDelText = null) |
| | | { |
| | | if (btnDelText == null) |
| | |
| | | var resultData = await doorLock.DefaultControlAsync(passData); |
| | | if (resultData != null && resultData.defaultControlResponseData != null) |
| | | { |
| | | if (resultData.defaultControlResponseData.status == 0) |
| | | if (resultData.defaultControlResponseData.status == 0 || resultData.defaultControlResponseData.status == 2) |
| | | { |
| | | var delDoorLockTempPasswordData = new ZigBee.Device.DoorLock.DelDoorLockTempPasswordData(); |
| | | if (UserCenterResourse.UserInfo.AuthorityNo != 1) |
| | |
| | | } |
| | | } |
| | | |
| | | //读取云端存储数据 |
| | | /// <summary> |
| | | /// 读取云端存储数据 |
| | | /// </summary> |
| | | void ReadTempPasswordData() |
| | | { |
| | | System.Threading.Tasks.Task.Run(async () => |
| | |
| | | }); |
| | | } |
| | | |
| | | //本地时间数据处理 |
| | | /// <summary> |
| | | /// 本地时间数据处理 |
| | | /// </summary> |
| | | /// <param name="validTimeDateTime"></param> |
| | | /// <param name="inValidTime"></param> |
| | | /// <param name="isClearLocalTime"></param> |
| | | void TimeDateData(DateTime validTimeDateTime, DateTime inValidTime, bool isClearLocalTime = false) |
| | | { |
| | | if (doorLock.tempPasswordObject != null) |
| | |
| | | } |
| | | } |
| | | |
| | | //时间显示数据处理 |
| | | /// <summary> |
| | | /// 时间显示数据处理 |
| | | /// </summary> |
| | | /// <param name="validTime"></param> |
| | | /// <param name="validTimeDate"></param> |
| | | /// <param name="inValidTime"></param> |
| | | /// <param name="inValidTimeDate"></param> |
| | | /// <param name="isDefaultTime"></param> |
| | | void TimeDisplay(Button validTime, Button validTimeDate, Button inValidTime, Button inValidTimeDate, bool isDefaultTime) |
| | | { |
| | | string hour = ""; |
| | |
| | | inValidTimeDate.Text = Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateMonth + Language.StringByID(R.MyInternationalizationString.Month) + Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateDay + Language.StringByID(R.MyInternationalizationString.Day); |
| | | } |
| | | |
| | | #region ◆ 接口实现__________________________ |
| | | #region 接口实现 |
| | | /// <summary> |
| | | /// 处理变化事件 --将弃用 改用DeviceInfoChange() |
| | | /// </summary> |