From 4b378188ce972df432b23d9cb73babb6cc0679c6 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期五, 17 一月 2020 14:56:15 +0800 Subject: [PATCH] 合并代码 ver.10086 --- ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TemporaryPassword.cs | 201 ++++++++++++++++++++++++++++++++------------------ 1 files changed, 129 insertions(+), 72 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TemporaryPassword.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TemporaryPassword.cs index ee6f735..09bc3c4 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TemporaryPassword.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TemporaryPassword.cs @@ -19,14 +19,38 @@ 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 @@ -68,65 +92,7 @@ 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; @@ -143,6 +109,9 @@ MidFrameLayoutContent(); } + /// <summary> + /// 涓儴甯冨眬 + /// </summary> public void MidFrameLayoutContent() { MidTopFrameLayout.RemoveAll(); @@ -318,7 +287,9 @@ }; #endregion } - //搴曢儴鐣岄潰鍜屾暟鎹鐞� + /// <summary> + /// 搴曢儴甯冨眬澶勭悊 + /// </summary> public void BottomFrameLayoutContent() { var bottomFrameLayout = new FrameLayout() @@ -389,7 +360,7 @@ var btnLine = new FrameLayout() { Width = Application.GetRealWidth(965), - Height = Application.GetRealHeight(5), + Height = 1, X = Application.GetRealWidth(58), BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine, }; @@ -507,7 +478,10 @@ }; } - //纭畾浜嬩欢澶勭悊 + /// <summary> + /// 纭畾浜嬩欢澶勭悊 + /// </summary> + /// <param name="btnFinifh"></param> void FinifhEventHandler(Button btnFinifh) { System.Threading.Tasks.Task.Run(async () => @@ -667,7 +641,76 @@ }); } - //娓呴櫎浜嬩欢澶勭悊 + /// <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) @@ -683,7 +726,7 @@ 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) @@ -749,7 +792,9 @@ } } - //璇诲彇浜戠瀛樺偍鏁版嵁 + /// <summary> + /// 璇诲彇浜戠瀛樺偍鏁版嵁 + /// </summary> void ReadTempPasswordData() { System.Threading.Tasks.Task.Run(async () => @@ -809,7 +854,12 @@ }); } - //鏈湴鏃堕棿鏁版嵁澶勭悊 + /// <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) @@ -844,7 +894,14 @@ } } - //鏃堕棿鏄剧ず鏁版嵁澶勭悊 + /// <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 = ""; @@ -921,7 +978,7 @@ 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> -- Gitblit v1.8.0