From 3272ca5b51e19f7f8a827b0f68400570a547fe60 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期二, 28 四月 2020 15:02:44 +0800
Subject: [PATCH] 2020-04-28-1

---
 ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/ChooseKeyModePage.cs |  117 +++++++++++++++++++++++++++++++---------------------------
 1 files changed, 63 insertions(+), 54 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/ChooseKeyModePage.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/ChooseKeyModePage.cs
index 953f73e..7fd5ff7 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/ChooseKeyModePage.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/ChooseKeyModePage.cs
@@ -5,19 +5,8 @@
 using static ZigBee.Device.BindObj;
 namespace Shared.Phone.UserCenter.DeviceBind
 {
-    public class ChooseKeyModePage : BindCommonLayout, ZigBee.Common.IStatus
+    public class ChooseKeyModePage : BindCommonLayout
     {
-        /// <summary>
-        /// 鎸夐敭妯″紡鎺ユ敹
-        /// </summary>
-        /// <param name="common">Common.</param>
-        public void Changed(CommonDevice common)
-        {
-            Shared.Application.RunOnMainThread(() =>
-            {
-            });
-        }
-
         /// 鏋勯�犲嚱鏁�
         /// </summary>
         /// <param name="doorLock"></param>
@@ -29,23 +18,46 @@
             this.targetList = targetSelectList;
         }
 
-        #region 鈼� 鍙橀噺鐢虫槑__________________________
-        ZigBee.Device.Panel currentKey;//褰撳墠鎸夐敭
-        //鏄剧ず琚粦瀹氳澶囨垨鍦烘櫙鐨剉iew
-        VerticalScrolViewLayout midVerticalScrolViewLayout;//涓儴鍒锋柊鍒楄〃
-        HorizontalScrolViewLayout btnHorizontalScrolViewLayout;//鎴块棿鍒楄〃宸﹀彸婊戝姩甯冨眬
+        #region 鍙橀噺鐢虫槑
+        /// <summary>
+        /// 褰撳墠鎸夐敭
+        /// </summary>
+        ZigBee.Device.Panel currentKey;
+        /// <summary>
+        /// 涓儴鍒锋柊鍒楄〃
+        /// </summary>
+        VerticalScrolViewLayout midVerticalScrolViewLayout;
+        /// <summary>
+        /// 鎴块棿鍒楄〃宸﹀彸婊戝姩甯冨眬
+        /// </summary>
+        HorizontalScrolViewLayout btnHorizontalScrolViewLayout;
         /// <summary>
         /// 鎸夐敭閰嶇疆鐨勭洰鏍囧垪琛�
         /// </summary>
-        List<CommonDevice> targetList = new List<CommonDevice>();//鏈湴涓存椂閫変腑鍒楄〃
+        List<CommonDevice> targetList = new List<CommonDevice>();
         /// <summary>
-        /// 鏂扮殑鎸夐敭閰嶇疆鐩爣鍒楄〃涓紝鐩爣瀹為檯瀛樺湪鎸夐敭涓紝姝ゆ椂瑕佸垹鎺夌殑鏁版嵁
+        /// 鏈湴鏃х殑閫変腑鍒楄〃
         /// </summary>
-        List<CommonDevice> oldTargetList = new List<CommonDevice>();//鏈湴鏃х殑閫変腑鍒楄〃
-        int currentClusterID = 6;//褰撳墠绨嘔D
-        public Action<List<BindListResponseObj>> action;//鍥炶皟缁戝畾鐩爣椤甸潰鍒锋柊
-        int currentModeID = 0;//褰撳墠妯″紡ID
-        string curDeviceBindType = "";//褰撳墠璁惧缁戝畾绫诲瀷
+        List<CommonDevice> oldTargetList = new List<CommonDevice>();
+        /// <summary>
+        /// 褰撳墠绨嘔D
+        /// </summary>
+        int currentClusterID = 6;
+        /// <summary>
+        /// 鍥炶皟缁戝畾鐩爣椤甸潰鍒锋柊
+        /// </summary>
+        public Action<List<BindListResponseObj>> action;
+        /// <summary>
+        /// 褰撳墠妯″紡ID
+        /// </summary>
+        int currentModeID = 0;
+        /// <summary>
+        /// 褰撳墠璁惧缁戝畾绫诲瀷
+        /// </summary>
+        string curDeviceBindType = "";
+        /// <summary>
+        /// 绫诲瀷鐨勫叿浣撴ā寮忓垪琛�
+        /// </summary>
         List<int> typeDetailModeList = new List<int> { };
         #endregion
 
@@ -232,18 +244,7 @@
 
                             var dev = new AddedDeviceBindResponseAllData();
                             dev = await currentKey.AddDeviceBindAsync(addBindeDev);
-                            if (dev.addedDeviceBindResponseData == null)
-                            {
-                                Application.RunOnMainThread(() =>
-                                {
-                                    CommonPage.Loading.Hide();
-                                    new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh);
-                                });
-                                btnFinifh.Enable = true;
-                                btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
-                                return;
-                            }
-                            else
+                            if (dev != null && dev.addedDeviceBindResponseData != null)
                             {
                                 if (dev.addedDeviceBindResponseData.Result == 0)
                                 {
@@ -305,6 +306,17 @@
                                     btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                     return;
                                 }
+                            }
+                            else
+                            {
+                                Application.RunOnMainThread(() =>
+                                {
+                                    CommonPage.Loading.Hide();
+                                    new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh);
+                                });
+                                btnFinifh.Enable = true;
+                                btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+                                return;
                             }
                         }
                         else
@@ -578,6 +590,9 @@
             });
         }
 
+        /// <summary>
+        /// 娣诲姞寮�鍏虫ā寮�
+        /// </summary>
         async private void AddSwitchMode()
         {
             if (typeDetailModeList == null)
@@ -619,8 +634,8 @@
 
                 var btnChoose = new Button()
                 {
-                    Width = Application.GetRealWidth(60),
-                    Height = Application.GetRealHeight(60),
+                    Width = Application.GetMinReal(60),
+                    Height = Application.GetMinReal(60),
                     X = Application.GetRealWidth(861 + 81),
                     Y = Application.GetRealHeight(35),
                     SelectedImagePath = "DoorLock/SelectedIcon.png",
@@ -723,6 +738,9 @@
             }
         }
 
+        /// <summary>
+        /// 娣诲姞璋冨厜妯″紡
+        /// </summary>
         async private void AddDimmerMode()
         {
             if (typeDetailModeList == null)
@@ -775,8 +793,8 @@
 
                 var btnChoose = new Button()
                 {
-                    Width = Application.GetRealWidth(60),
-                    Height = Application.GetRealHeight(60),
+                    Width = Application.GetMinReal(60),
+                    Height = Application.GetMinReal(60),
                     X = Application.GetRealWidth(861 + 81),
                     Y = Application.GetRealHeight(35),
                     SelectedImagePath = "DoorLock/SelectedIcon.png",
@@ -905,6 +923,9 @@
             }
         }
 
+        /// <summary>
+        /// 娣诲姞绐楀笜妯″紡
+        /// </summary>
         async private void AddCurtainMode()
         {
             if (typeDetailModeList == null)
@@ -946,8 +967,8 @@
 
                 var btnChoose = new Button()
                 {
-                    Width = Application.GetRealWidth(60),
-                    Height = Application.GetRealHeight(60),
+                    Width = Application.GetMinReal(60),
+                    Height = Application.GetMinReal(60),
                     X = Application.GetRealWidth(861 + 81),
                     Y = Application.GetRealHeight(35),
                     SelectedImagePath = "DoorLock/SelectedIcon.png",
@@ -1074,18 +1095,6 @@
                 btnChoose.MouseUpEventHandler += hander;
                 i++;
             }
-        }
-
-        public void DeviceInfoChange(CommonDevice common, string typeTag)
-        {
-        }
-
-        public void ChangedILogicStatus(ZigBee.Device.Logic logic)
-        {
-        }
-
-        public void ChangedISceneStatus(Scene scene)
-        {
         }
     }
 }

--
Gitblit v1.8.0