From 528c105b3aea0e6e00477365f16f57c1e3d7eb1c Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期四, 24 十月 2019 15:31:28 +0800
Subject: [PATCH] 2019-10-24-3

---
 ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceDryContactSettionForm.cs |  167 +++++++++++++++++--------------------------------------
 1 files changed, 52 insertions(+), 115 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceDryContactSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceDryContactSettionForm.cs
index f9aed15..c6b48bf 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceDryContactSettionForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceDryContactSettionForm.cs
@@ -1,4 +1,5 @@
-锘縰sing System;
+锘縰sing Shared.Common;
+using System;
 using System.Collections.Generic;
 using System.Text;
 using System.Threading.Tasks;
@@ -49,47 +50,47 @@
         /// <summary>
         /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
         /// </summary>
-        /// <param name="i_deviceMac">璁惧Mac鍦板潃</param>
-        public void ShowForm(string i_deviceMac)
-        {
+        /// <param name="i_deviceMac">璁惧Mac鍦板潃</param>
+        public void ShowForm(string i_deviceMac)
+        {
             this.deviceMac = i_deviceMac;
             var listDevice = Common.LocalDevice.Current.GetDevicesByMac(deviceMac);
             //鑾峰彇杩欎竴鍫嗚澶囨椂灞炰簬浠�涔堢被鍨嬬殑
-            this.deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(listDevice);
-
-            //璁剧疆澶撮儴淇℃伅
-            base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uDryContactSettion));
-
-            //鍒濆鍖栦腑閮ㄤ俊鎭�
+            this.deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(listDevice);
+
+            //璁剧疆澶撮儴淇℃伅
+            base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uDryContactSettion));
+
+            //鍒濆鍖栦腑閮ㄤ俊鎭�
             this.InitMiddleFrame();
 
             //鍒濆鍖栧彸涓婅鑿滃崟
-            this.InitTopRightMenu();
-        }
-
-        /// <summary>
-        /// 鍒濆鍖栦腑閮ㄤ俊鎭�
-        /// </summary>
-        private void InitMiddleFrame()
+            this.InitTopRightMenu();
+        }
+
+        /// <summary>
+        /// 鍒濆鍖栦腑閮ㄤ俊鎭�
+        /// </summary>
+        private void InitMiddleFrame()
         {
             //娓呯┖bodyFrame
-            this.ClearBodyFrame();
-
-            //鍒濆鍖栨甯�
-            this.InitFrameTable();
+            this.ClearBodyFrame();
+
+            //鍒濆鍖栨甯�
+            var tableContr = new InformationEditorControl();
+            this.listview = tableContr.InitControl(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uDeviceEditor), 562, 1175);
+
             //鍒濆鍖栬澶囧洖璺浘鏍�
             this.InitDeviceEpointIcon();
 
+            //鍒濆鍖栨甯冨畬鎴�
+            tableContr.FinishInitControl(bodyFrameLayout, this.listview);
+            tableContr = null;
+
             //淇濆瓨
             var btnFinish = new BottomClickButton();
-            //鍊熺敤Y杞村潗鏍�(璁╄繖涓尯鍩熶笉鑳界偣鍑昏彍鍗�)
-            var frameBack = new FrameLayout();
-            frameBack.Y = btnFinish.Yaxis;
-            frameBack.Height = bodyFrameLayout.Height - btnFinish.Yaxis;
-            bodyFrameLayout.AddChidren(frameBack);
-
-            btnFinish.TextID = R.MyInternationalizationString.uSave;
-            bodyFrameLayout.AddChidren(btnFinish);
+            btnFinish.TextID = R.MyInternationalizationString.uSave;
+            bodyFrameLayout.AddChidren(btnFinish);
             btnFinish.ButtonClickEvent += async (sender, e) =>
             {
                 //璁板綍璧峰綋鍓嶆鍦ㄦ搷浣滅殑鍥炶矾鍚嶅瓧
@@ -121,7 +122,7 @@
                 this.CloseProgressBar();
                 //鍏抽棴鑷韩
                 this.CloseForm();
-            };
+            };
         }
 
         /// <summary>
@@ -166,36 +167,22 @@
             };
 
             //鎵�灞炲尯鍩�
-            List<string> listRoomName = Common.Room.CurrentRoom.GetRoomListNameByDevice(nowSelectDevice);
-            caption = Language.StringByID(R.MyInternationalizationString.uBelongArea);
-            nameValue = Common.Room.CurrentRoom.GetRoomName(listRoomName);
-            var btnBeloneArea = new FrameCaptionViewControl(caption, nameValue, listview.rowSpace / 2);
-            listview.AddChidren(btnBeloneArea);
-            btnBeloneArea.InitControl();
+            var rowBeloneArea = new BelongAreaControl(listview.rowSpace / 2);
+            listview.AddChidren(rowBeloneArea);
+            rowBeloneArea.InitControl(Language.StringByID(R.MyInternationalizationString.uBelongArea), nowSelectDevice);
             //搴曠嚎
-            btnBeloneArea.AddBottomLine();
-            //鍙崇澶�
-            btnBeloneArea.AddRightIconControl();
-            btnBeloneArea.ButtonClickEvent += (sender, e) =>
+            rowBeloneArea.AddBottomLine();
+            rowBeloneArea.SelectRoomEvent += (roomKeys) =>
             {
-                var form = new SelectRoomForm();
-                form.AddForm(listRoomName);
-                form.ActionSelectRoom = (list) =>
-                {
-                    //鍙樻洿鎴块棿
-                    Common.Room.CurrentRoom.ChangedRoom(nowSelectDevice, list);
+                //鍙樻洿鎴块棿
+                Common.Room.CurrentRoom.ChangedRoom(nowSelectDevice, roomKeys);
+            };
 
-                    btnBeloneArea.Text = Common.Room.CurrentRoom.GetRoomName(list);
-                    listRoomName.Clear();
-                    listRoomName.AddRange(list);
-                };
-            };
-
-            //3璺户鐢靛櫒鎴栬��1璺皟鍏夊櫒绗竷鍥炶矾鐨勯厤缃俊鎭�
-            List<CommonDevice.AttributeDataObj> listRelayInfo7 = null;
-
-            bool isHdlDevice = Common.LocalDevice.Current.IsHdlDevice(nowSelectDevice);
-            //娌充笢璁惧鎵嶄細寮�鍚閫夐」
+            //3璺户鐢靛櫒鎴栬��1璺皟鍏夊櫒绗竷鍥炶矾鐨勯厤缃俊鎭�
+            List<CommonDevice.AttributeDataObj> listRelayInfo7 = null;
+
+            bool isHdlDevice = Common.LocalDevice.Current.IsHdlDevice(nowSelectDevice);
+            //娌充笢璁惧鎵嶄細寮�鍚閫夐」
             if (isHdlDevice == true)
             {
                 //濡傛灉鏄�3璺户鐢靛櫒鎴栬��1璺皟鍏夊櫒,骞朵笖鏄涓冨洖璺殑鏃跺��,瀹冨ソ鍍忓彲浠ユ敼鍙樼被鍨�
@@ -223,27 +210,15 @@
             this.AddBindRow(listRelayInfo7);
             //娣诲姞鑳屽厜鐏
             this.AddBackLightRow();
-
-            //鍊熺敤Y杞村潗鏍�
-            var btnTemp = new BottomClickButton();
-            var realHeight = listview.GetChildren(0).Height * listview.ChildrenCount;
-            if (bodyFrameLayout.Height - btnTemp.Yaxis + realHeight > listview.Height)
-            {
-                //淇冧娇琚尅浣忕殑鑿滃崟鑳藉鍚戜笂婊戝姩
-                var frameTemp = new FrameLayout();
-                frameTemp.Height = bodyFrameLayout.Height - btnTemp.Yaxis + Application.GetRealHeight(115);
-                listview.AddChidren(frameTemp);
-            }
-            btnTemp = null;
         }
 
         #endregion
 
-        #region 鈻� 鍙充笂瑙掕彍鍗昣________________________
+        #region 鈻� 鍙充笂瑙掕彍鍗昣________________________
 
         /// <summary>
         /// 鍒濆鍖栧彸涓婅鑿滃崟
-        /// </summary>
+        /// </summary>
         private void InitTopRightMenu()
         {
             var btnIcon = new MostRightIconControl(69, 69);
@@ -255,11 +230,11 @@
                 //鏄剧ず鍙充笂瑙掕彍鍗曠晫闈�
                 this.ShowTopRightMenu();
             });
-        }
-
+        }
+
         /// <summary>
         /// 鏄剧ず鍙充笂瑙掕彍鍗曠晫闈�
-        /// </summary>
+        /// </summary>
         private void ShowTopRightMenu()
         {
             int menuCount = 1;
@@ -314,7 +289,7 @@
             if (listRelayInfo7 != null)
             {
                 //鍙崇澶�
-                btnFunction.AddRightIconControl();
+                btnFunction.AddRightArrow();
 
                 int nowSelectNo = 1;
                 foreach (var data in listRelayInfo7)
@@ -397,7 +372,7 @@
                 //搴曠嚎
                 btnBind.AddBottomLine();
                 //鍙崇澶�
-                btnBind.AddRightIconControl();
+                btnBind.AddRightArrow();
                 btnBind.ButtonClickEvent += (sender, e) =>
                 {
                 };
@@ -428,7 +403,7 @@
                 //搴曠嚎
                 btnLight.AddBottomLine();
                 //鍙崇澶�
-                btnLight.AddRightIconControl();
+                btnLight.AddRightArrow();
                 btnLight.ButtonClickEvent += (sender, e) =>
                 {
                     var form = new RelayThreeLoadBackLightSettionForm();
@@ -593,44 +568,6 @@
                 listIcon.Insert(0, listTemp);
             }
             return listIcon;
-        }
-
-        #endregion
-
-        #region 鈻� 鍒濆鍖栨甯僟________________________
-
-        /// <summary>
-        /// 鍒濆鍖栨甯�
-        /// </summary>
-        private void InitFrameTable()
-        {
-            //寮у害鐨勫渾鐨勪竴鍗婄殑楂樺害(鍥哄畾)
-            int halfRoundHeigth = Application.GetRealHeight(116) / 2;
-            //寮у害鐨勫渾
-            var btnRound = new NormalViewControl(bodyFrameLayout.Width, halfRoundHeigth * 2, false);
-            btnRound.Y = Application.GetRealHeight(562);
-            btnRound.BackgroundColor = UserCenterColor.Current.White;
-            btnRound.Radius = (uint)halfRoundHeigth;
-            bodyFrameLayout.AddChidren(btnRound);
-            //鏄庣粏鍒楄〃鐨勬甯冿紝鐧借壊鑳屾櫙(瑕嗙洊寮у害鐨勫渾鐨勫崐杈�)
-            var detailBackFrame = new FrameLayout();
-            detailBackFrame.Y = btnRound.Bottom - btnRound.Height / 2;
-            detailBackFrame.Height = Application.GetRealHeight(1175);//楂樺害灏辨槸瑕佸畠瓒呰繃
-            detailBackFrame.BackgroundColor = UserCenterColor.Current.White;
-            bodyFrameLayout.AddChidren(detailBackFrame);
-
-            //璁惧缂栬緫
-            var btnTile = new NormalViewControl(800, 60, true);
-            btnTile.X = ControlCommonResourse.XXLeft;
-            btnTile.TextSize = 15;
-            btnTile.TextColor = UserCenterColor.Current.TextColor2;
-            btnTile.TextID = R.MyInternationalizationString.uDeviceEditor;
-            detailBackFrame.AddChidren(btnTile);
-
-            this.listview = new VerticalListControl(12);
-            listview.Y = btnTile.Bottom + Application.GetRealHeight(17);
-            listview.Height = Application.GetRealHeight(1175) - halfRoundHeigth - btnTile.Bottom - Application.GetRealHeight(17);
-            detailBackFrame.AddChidren(listview);
         }
 
         #endregion

--
Gitblit v1.8.0