From 48ba446936b51fffafa7c3600c0dadc6ac0e8c20 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期五, 10 七月 2020 10:52:13 +0800
Subject: [PATCH] 2020-07-10-01

---
 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs |   76 ++++++++++++++++++++++++++-----------
 1 files changed, 53 insertions(+), 23 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs
index 64a8ada..8d69a71 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs
@@ -1,28 +1,38 @@
 锘縰sing System;
 using System.Collections.Generic;
 using Shared.Common;
+using Shared.Phone.UserView;
 using ZigBee.Device;
 
 namespace Shared.Phone.UserCenter.DoorLock
 {
     public class FunctionSetting : DoorLockCommonLayout
     {
-        #region  鏋勯�犲嚱鏁�
+        #region  鏋勯�犲嚱鏁� 
         /// <summary>
         /// 鏋勯�犲嚱鏁�
         /// </summary>
         /// <param name="doorLock"></param>
-        public FunctionSetting(ZigBee.Device.DoorLock doorLock)
+        public FunctionSetting(Room room, CommonDevice doorLock)
         {
-            //闂��
-            this.doorLock = doorLock;
+            this.doorLock = doorLock as ZigBee.Device.DoorLock;
+            currentRoom = room;
+            deviceUI = doorLock;
             listNewDevice.Add(doorLock);
             BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor;
         }
         #endregion
 
-        #region  鍙橀噺鐢虫槑
+        #region  鍙橀噺鐢虫槑 
         public ZigBee.Device.DoorLock doorLock = null;
+        /// <summary>
+        /// 褰撳墠鎴块棿
+        /// </summary>
+        Room currentRoom;
+        /// <summary>
+        /// 璁惧UI瀵硅薄
+        /// </summary>
+        CommonDevice deviceUI;
         /// <summary>
         /// 璁惧闇�瑕佷繚瀛樼殑璁惧鍚嶅瓧
         /// </summary>
@@ -52,9 +62,9 @@
         FrameLayout bottomFrameLayout;
         #endregion
 
-        #region  UI鏄剧ず
+        #region  UI鏄剧ず  
         /// <summary>
-        /// UI鏄剧ず
+        /// UI鏄剧ず 
         /// </summary>
         public void Show()
         {
@@ -73,7 +83,7 @@
         }
         #endregion
 
-        #region  涓儴鏄剧ず
+        #region  涓儴鏄剧ず  
         public void MidFrameLayoutContent()
         {
             //鍥剧墖
@@ -98,10 +108,10 @@
         }
         #endregion
 
-        #region  搴曢儴鏄剧ず
+        #region  搴曢儴鏄剧ず 
         public void BottomFrameLayout()
         {
-            #region  UI
+            #region  UI 
             bottomFrameLayout = new FrameLayout()
             {
                 Height = Application.GetRealHeight(1319),
@@ -135,7 +145,7 @@
         }
         #endregion
 
-        #region  鍔熻兘鏄剧ず
+        #region  鍔熻兘鏄剧ず  
         void FunctionDetail(ZigBee.Device.DoorLock doorLock)
         {
             listview.RemoveAll();
@@ -171,8 +181,16 @@
             var listCheck = new List<string>();
             rowBeloneArea.SelectRoomEvent += (roomKeys) =>
             {
+                //閫夋嫨鏈垎閰嶆椂,娓呯┖
+                if (roomKeys == string.Empty) { listCheck = new List<string>(); }
                 foreach (var device in this.listNewDevice)
-                {
+                {
+                    if (roomKeys == string.Empty)
+                    {
+                        //濡傛灉閫夋嫨鐨勬槸鏈垎閰嶏紝鍒欏畠鐨勫叏閮ㄥ洖璺棤鏉′欢鍏ㄩ儴娓呯┖鎴块棿
+                        HdlRoomLogic.Current.ChangedRoom(device, roomKeys);
+                        continue;
+                    }
                     var room = HdlRoomLogic.Current.GetRoomByDevice(device);
                     string mainKeys = LocalDevice.Current.GetDeviceMainKeys(device);
                     if (room == null)
@@ -192,7 +210,7 @@
             };
 
             //璁惧妯″潡
-            caption = Language.StringByID(R.MyInternationalizationString.BelongModel);
+            caption = Language.StringByID(R.MyInternationalizationString.BelongDevice);
             deviceName = Common.LocalDevice.Current.GetDeviceObjectText(listNewDevice);
             var btnType = new FrameCaptionViewControl(caption, deviceName, listview.rowSpace / 2);
             btnType.UseClickStatu = false;
@@ -230,7 +248,7 @@
         }
         #endregion
 
-        #region  娣诲姞鍏ㄩ儴鑿滃崟
+        #region  娣诲姞鍏ㄩ儴鑿滃崟 
         /// <summary>
         /// 娣诲姞鍏ㄩ儴鑿滃崟
         /// </summary>
@@ -253,7 +271,7 @@
         }
         #endregion
 
-        #region 涓存椂瀵嗙爜
+        #region 涓存椂瀵嗙爜 
         /// <summary>
         /// 涓存椂瀵嗙爜
         /// </summary>
@@ -279,7 +297,7 @@
                 };
                 actionNone = async () =>
                 {
-                    Shared.Phone.UserCenter.DoorLock.DoorLockCommonLayout.SecurityRequest(doorLock, action);
+                    Shared.Phone.UserCenter.DoorLock.DoorLockCommonLayout.SecurityRequest(doorLock);
                 };
                 HdlCheckLogic.Current.CheckSecondarySecurity(action, actionNone);
             };
@@ -287,7 +305,7 @@
 
         #endregion
 
-        #region 杩滅▼寮�閿�
+        #region 杩滅▼寮�閿� 
         /// <summary>
         /// 娣诲姞銆愯繙绋嬪紑閿併�戣锛堥棬閿佷笓鐢級
         /// </summary>
@@ -357,7 +375,7 @@
 
         #endregion
 
-        #region 闂ㄩ攣鏃堕棿
+        #region 闂ㄩ攣鏃堕棿 
 
         /// <summary>
         /// 娣诲姞銆愰棬閿佹椂闂淬�戣锛堥棬閿佷笓鐢級
@@ -403,19 +421,19 @@
 
         #endregion
 
-        #region  璁惧閲嶅懡鍚�
+        #region  璁惧閲嶅懡鍚� 
         /// <summary>
         /// 璁惧閲嶅懡鍚�
         /// </summary>
         /// <param name="i_deviceName">deviceName.</param>
-        private async void DeviceReName(string i_deviceName, bool closeForm)
+        private void DeviceReName(string i_deviceName, bool closeForm)
         {
             //寮�鍚繘搴︽潯
             this.ShowProgressBar();
 
             //淇敼MAC鍚�
             string deviceName = i_deviceName.Trim();
-            var result = await Common.LocalDevice.Current.ReMacName(listNewDevice, deviceName);
+            var result = Common.LocalDevice.Current.ReMacName(listNewDevice, deviceName);
             //鍏抽棴杩涘害鏉�
             this.CloseProgressBar();
 
@@ -444,10 +462,10 @@
         }
         #endregion
 
-        #region  琛屾暟瓒呰繃瀹瑰櫒鏃讹紝琛ヤ竴涓┖鐧紽rameLayout
+        #region  琛屾暟瓒呰繃瀹瑰櫒鏃讹紝琛ヤ竴涓┖鐧紽rameLayout 
         /// <summary>
         /// 琛屾暟瓒呰繃瀹瑰櫒鏃讹紝琛ヤ竴涓┖鐧紽rameLayout锛屼娇涔嬭兘婊戝姩
-        /// </summary>
+        /// </summary> 
         void FinishInitControl(FrameLayout bodyFrameLayout, VerticalListControl listview)
         {
             if (listview.ChildrenCount > 0)
@@ -464,5 +482,17 @@
             }
         }
         #endregion
+
+        #region 绉婚櫎鏂规硶
+        /// <summary>
+        /// 閲嶅啓绉婚櫎鏂规硶
+        /// </summary>
+        public override void RemoveFromParent()
+        {
+            base.RemoveFromParent();
+        }
+        #endregion
     }
 }
+
+

--
Gitblit v1.8.0