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/CommonBase/Controls/DeviceControls/DeviceSelectControl.cs |   54 +++++++++++++-----------------------------------------
 1 files changed, 13 insertions(+), 41 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceSelectControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceSelectControl.cs
index b7c2442..1059d0e 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceSelectControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceSelectControl.cs
@@ -20,14 +20,6 @@
             get { return Common.LocalDevice.Current.GetDevice(MainKeys); }
         }
         /// <summary>
-        /// 鎴块棿鎺т欢
-        /// </summary>
-        private NormalViewControl btnRoom = null;
-        /// <summary>
-        /// 璁惧鎺т欢
-        /// </summary>
-        private NormalViewControl btnDevie = null;
-        /// <summary>
         /// 閫夋嫨鎺т欢
         /// </summary>
         private MostRightIconControl btnSelect = null;
@@ -70,14 +62,18 @@
         /// 鍋氭垚涓�涓樉绀鸿澶囧洖璺�+鎴块棿鐨凴owLayout
         /// </summary>
         /// <param name="i_device">璁惧瀵硅薄</param>
-        /// <param name="i_ChidrenYaxis">瀛愭帶浠禮杞村亸绉婚噺(鐪熷疄鍊�,鏈変簺鐣岄潰闇�瑕佽繖绉嶇壒娈婃搷浣�)</param>
-        public DeviceSelectControl(CommonDevice i_device, int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis)
+        /// <param name="autoSelect">褰撶偣鍑绘鎺т欢鏃�,鏄惁鑷姩璁剧疆閫夋嫨鐘舵��</param>
+        /// <param name="i_ChidrenYaxis">瀛愭帶浠禮杞村亸绉婚噺(銆愬垪琛ㄦ帶浠剁殑rowSpace/2銆戝嵆鍙�,涓嶆噦榛樿涓�0鍗冲彲)</param>
+        public DeviceSelectControl(CommonDevice i_device, bool autoSelect, int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis)
         {
             this.MainKeys = Common.LocalDevice.Current.GetDeviceMainKeys(i_device);
-            this.ButtonClickEvent += (sender, e) =>
+            if (autoSelect == true)
             {
-                this.IsSelected = Statu == StatuMode.SELECT ? false : true;
-            };
+                this.ButtonClickEvent += (sender, e) =>
+                {
+                    this.IsSelected = Statu == StatuMode.SELECT ? false : true;
+                };
+            }
         }
 
         /// <summary>
@@ -91,24 +87,15 @@
 
             //璁惧
             string eName = Common.LocalDevice.Current.GetDeviceEpointName(device);
-            btnDevie = this.AddLeftCaption(eName, 850, 60);
-            btnDevie.TextSize = 15;
-            //杩欎釜鍧愭爣鏈夌偣鐗规畩
-            btnDevie.Y = Application.GetRealHeight(12) + this.chidrenYaxis;
-            this.AddChidren(btnDevie, ChidrenBindMode.BindEventOnly);
+            this.AddTopView(eName, 850);
 
             //鎴块棿
-            string roomName = Common.Room.CurrentRoom.GetRoomNameByDevice(device);
-            btnRoom = this.AddLeftCaption(roomName, 850, 50, true);
-            //杩欎釜鍧愭爣鏈夌偣鐗规畩
-            btnRoom.Y = Application.GetRealHeight(72) + this.chidrenYaxis;
-            btnRoom.TextSize = 12;
-            btnRoom.TextColor = UserCenterColor.Current.TextGrayColor1;
-            this.AddChidren(btnRoom, ChidrenBindMode.BindEventOnly);
+            string roomName = HdlRoomLogic.Current.GetRoomNameByDevice(device);
+            this.AddBottomView(roomName, 850);
 
             btnSelect = this.AddMostRightEmptyIcon(58, 58);
             btnSelect.Visible = false;
-            btnSelect.UnSelectedImagePath = "Item/Tick.png";
+            btnSelect.UnSelectedImagePath = "Item/ItemSelected.png";
         }
 
         #endregion
@@ -145,21 +132,6 @@
         #endregion
 
         #region 鈻� 涓�鑸柟娉昣__________________________
-
-        /// <summary>
-        /// 绉婚櫎鎴块棿鎺т欢
-        /// </summary>
-        public void RemoveRoomControl()
-        {
-            //绉婚櫎浜嬩欢
-            this.ChangedChidrenBindMode(btnRoom, ChidrenBindMode.NotBind);
-            this.btnRoom.RemoveFromParent();
-            this.btnDevie.Gravity = Gravity.CenterVertical;
-            if (chidrenYaxis != 0)
-            {
-                this.btnDevie.Y += chidrenYaxis;
-            }
-        }
 
         #endregion
     }

--
Gitblit v1.8.0