From d6fb0646531172f23648441c224cdcccd721b894 Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期一, 14 十二月 2020 09:59:01 +0800
Subject: [PATCH] 请合并代码,完成晾衣架最终功能。

---
 ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayVirtualDriveInfoForm.cs |  138 ++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 138 insertions(+), 0 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayVirtualDriveInfoForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayVirtualDriveInfoForm.cs
new file mode 100755
index 0000000..ec3cf80
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Update/GatewayVirtualDriveInfoForm.cs
@@ -0,0 +1,138 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+using ZigBee.Device;
+
+namespace Shared.Phone.UserCenter.GatewayUpdate
+{
+    /// <summary>
+    /// 缃戝叧铏氭嫙椹卞姩鍒楄〃鐣岄潰
+    /// </summary>
+    public class GatewayVirtualDriveInfoForm : EditorCommonForm
+    {
+        #region 鈻� 鍙橀噺澹版槑___________________________
+
+        /// <summary>
+        /// 铏氭嫙椹卞姩鍙峰垪琛ㄤ俊鎭�
+        /// </summary>
+        private List<ZbGatewayData.DriveCodeObj> listCode = null;
+
+        #endregion
+
+        #region 鈻� 鍒濆鍖朹____________________________
+
+        /// <summary>
+        /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
+        /// </summary>
+        /// <param name="i_listCode">铏氭嫙椹卞姩鍙峰垪琛ㄤ俊鎭�</param>
+        public void ShowForm(List<ZbGatewayData.DriveCodeObj> i_listCode)
+        {
+            this.listCode = i_listCode;
+
+            //璁剧疆鏍囬淇℃伅
+            base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uVirtualDrive));
+
+            //鍒濆鍖栦腑閮ㄦ帶浠�
+            this.InitMiddleFrame();
+        }
+
+        /// <summary>
+        /// 鍒濆鍖栦腑閮ㄦ帶浠�
+        /// </summary>
+        private void InitMiddleFrame()
+        {
+            //娓呯┖bodyFrame
+            this.ClearBodyFrame();
+
+            var listView = new VerticalListControl(23);
+            listView.BackgroundColor = UserCenterColor.Current.White;
+            listView.Height = bodyFrameLayout.Height;
+            bodyFrameLayout.AddChidren(listView);
+
+            for (int i = 0; i < listCode.Count; i++)
+            {
+                //鍒涘缓涓�涓彲浠ュ睍寮�鍜屾敹缂╃殑FrameLayout,鐩稿綋浜庤彍鍗曟爮
+                var frameTable = new FrameListControl(12);
+                frameTable.Height = ControlCommonResourse.ListViewRowHeight + listView.rowSpace;
+                listView.AddChidren(frameTable);
+
+                //椹卞姩鍙疯彍鍗�
+                var rowMenu = new FrameRowControl(frameTable.rowSpace / 2);
+                frameTable.AddChidren(rowMenu);
+                rowMenu.AddLeftCaption(listCode[i].DriveCode.ToString(), 400);
+                rowMenu.AddBottomLine();
+
+                var btnRight = rowMenu.AddMostRightEmptyIcon(58, 58);
+                btnRight.UnSelectedImagePath = "Item/RightNext.png";
+                btnRight.SelectedImagePath = "Item/Down.png";
+                rowMenu.ButtonClickEvent += (sender, e) =>
+                {
+                    btnRight.IsSelected = !btnRight.IsSelected;
+                    //鍙樻洿鐨勯珮搴�,榛樿涓哄垪琛ㄩ殣钘�
+                    int heightValue = ControlCommonResourse.ListViewRowHeight + listView.rowSpace;
+                    if (btnRight.IsSelected == true)
+                    {
+                        //灞曞紑妯″紡鏃讹紝鎵╁ぇ渚濇嵁涓�:瀹冩湁鍑犱釜瀛愭帶浠�
+                        heightValue = frameTable.ChildrenCount * (ControlCommonResourse.ListViewRowHeight + frameTable.rowSpace);
+                    }
+                    //鑷韩楂樺害鍙樻洿
+                    frameTable.Height = heightValue;
+
+                    //鍙樻洿鍒楄〃楂樺害
+                    int realHeight = 0;
+                    for (int j = 0; j < listView.ChildrenCount; j++)
+                    {
+                        realHeight += listView.GetChildren(j).Height;
+                    }
+                    //搴曢儴绌虹櫧
+                    realHeight += Application.GetRealHeight(23);
+                    if (realHeight > bodyFrameLayout.Height)
+                    {
+                        realHeight = bodyFrameLayout.Height;
+                    }
+                    listView.Height = realHeight;
+                };
+
+                //闀滃儚ID
+                var row1 = new FrameRowControl(frameTable.rowSpace / 2);
+                row1.LeftOffset = Application.GetRealWidth(167) - ControlCommonResourse.XXLeft;
+                row1.UseClickStatu = false;
+                frameTable.AddChidren(row1);
+                row1.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uImageId), 300);
+                row1.AddMostRightView(listCode[i].DriveImageType.ToString(), 400);
+                row1.AddBottomLine();
+
+                //鍥轰欢鐗堟湰
+                var row2 = new FrameRowControl(frameTable.rowSpace / 2);
+                row2.LeftOffset = Application.GetRealWidth(167) - ControlCommonResourse.XXLeft;
+                row2.UseClickStatu = false;
+                frameTable.AddChidren(row2);
+                row2.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uFirmwareVersion), 300);
+                row2.AddMostRightView(Common.LocalDevice.Current.AppendVersion(listCode[i].DriveFwVersion), 400);
+                row2.AddBottomLine();
+
+                //鍥轰欢鏃ユ湡
+                var row3 = new FrameRowControl(frameTable.rowSpace / 2);
+                row3.LeftOffset = Application.GetRealWidth(167) - ControlCommonResourse.XXLeft;
+                row3.UseClickStatu = false;
+                frameTable.AddChidren(row3);
+                row3.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uHardwareDate), 300);
+                row3.AddMostRightView("", 400);
+                row3.AddBottomLine();
+
+                //纭欢鐗堟湰
+                var row4 = new FrameRowControl(frameTable.rowSpace / 2);
+                row4.LeftOffset = Application.GetRealWidth(167) - ControlCommonResourse.XXLeft;
+                row4.UseClickStatu = false;
+                frameTable.AddChidren(row4);
+                row4.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uHardwareVersion), 300);
+                row4.AddMostRightView(listCode[i].DriveHwVersion.ToString(), 400);
+                row4.AddBottomLine();
+            }
+
+            listView.AdjustRealHeight(Application.GetRealHeight(23));
+        }
+
+        #endregion
+    }
+}

--
Gitblit v1.8.0