From 9a4b76398009cf76c508d61f7e48fb6f5cb7ac2d Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期二, 21 七月 2020 09:46:53 +0800
Subject: [PATCH] 请合并最新多功能面板代码

---
 ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayListForm.cs |   42 ++++++++++++++++++++++--------------------
 1 files changed, 22 insertions(+), 20 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayListForm.cs
index ffbdd5d..1548f15 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayListForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayListForm.cs
@@ -95,8 +95,7 @@
             for (int i = 0; i < listway.Count; i++)
             {
                 //娣诲姞琛�
-                var gwId = HdlGatewayLogic.Current.GetGatewayId(listway[i]);
-                this.AddRowLayout(gwId, i != listway.Count - 1);
+                this.AddRowLayout(listway[i].GwId, i != listway.Count - 1);
             }
 
             //璋冩暣鍒楄〃鎺т欢鐨勯珮搴�
@@ -131,11 +130,18 @@
             //鎻愮ず鏂扮増鏈�
             var btnNew = new InformationTipView(gatewayRow.btnIcon);
             btnNew.Visible = false;
-            gatewayRow.frameTable.AddChidren(btnNew, ChidrenBindMode.BindEventOnly);
+            gatewayRow.frameTable.AddChidren(btnNew, ChidrenBindMode.BindEvent);
             gatewayRow.AddTag("btnNew", btnNew);
             //鍗曞嚮浜嬩欢
             gatewayRow.frameTable.ButtonClickEvent += (sender, e) =>
             {
+                if (UserCenterResourse.HideOption.GotoGatewayProductInfoForm == 1)
+                {
+                    //寮哄埗璺宠浆
+                    var form2 = new GatewayProductInfoForm();
+                    form2.AddForm(gateway);
+                    return;
+                }
                 var form = new GatewayInfoEditorForm();
                 form.AddForm(gateway);
             };
@@ -172,13 +178,8 @@
             };
 
             //瀹氫綅
-            var btnPosition = new NormalViewControl(Application.GetRealWidth(184), gatewayRow.Height, false);
-            btnPosition.BackgroundColor = 0xff4a4a4a;
-            btnPosition.TextAlignment = TextAlignment.Center;
-            btnPosition.TextColor = UserCenterColor.Current.White;
-            btnPosition.TextSize = 12;
+            var btnPosition = gatewayRow.AddEditorControl(false);
             btnPosition.TextID = R.MyInternationalizationString.uFixedPosition;
-            gatewayRow.AddRightView(btnPosition);
             btnPosition.ButtonClickEvent += (sender, e) =>
             {
                 //鍙戦�佸畾浣嶅懡浠�
@@ -205,7 +206,7 @@
                 {
                     HdlThreadLogic.Current.RunThread(() =>
                     {
-                        this.DeleteGateway(strWayId, gatewayRow);
+                        this.DeleteGateway(strWayId);
                     });
                 });
             };
@@ -224,7 +225,7 @@
                 btnNow.Y = Application.GetMinReal(23) + gatewayRow.frameTable.chidrenYaxis;
                 btnNow.UnSelectedImagePath = "Item/NowAcctionTip.png";
                 btnNow.X = gatewayRow.btnName.X + gatewayRow.btnName.GetRealWidthByText();
-                gatewayRow.frameTable.AddChidren(btnNow, ChidrenBindMode.BindEventOnly);
+                gatewayRow.frameTable.AddChidren(btnNow, ChidrenBindMode.BindEvent);
             }
         }
 
@@ -237,7 +238,7 @@
         /// </summary>
         /// <param name="strWayId"></param>
         /// <param name="row"></param>
-        private async void DeleteGateway(string strWayId, GatewayRowControl row)
+        private async void DeleteGateway(string strWayId)
         {
             //鎵撳紑杩涘害鏉�
             this.ShowProgressBar();
@@ -295,7 +296,7 @@
                     //鍏抽棴鐣岄潰
                     this.CloseForm();
                     //鍒锋柊涓荤敾闈�(涓嶉噸鏂拌幏鍙栬澶囩姸鎬�)
-                    this.LoadFormMethodByName("DeviceListMainForm", "InitMiddleFrame", false);
+                    this.LoadFormMethodByName("DeviceListMainForm", "InitMiddleFrame");
                 }
             });
         }
@@ -338,7 +339,7 @@
                         return;
                     }
                     bool online = HdlGatewayLogic.Current.CheckGatewayOnlineByFlag(way);
-                    this.GatewayOnlinePush(way, online);
+                    this.GatewayOnlinePush(way, online, true);
                 }
                 //缃戝叧鏂扮増鏈娴�
                 this.CheckGatewayNewVersion(listway);
@@ -350,7 +351,8 @@
         /// </summary>
         /// <param name="gateWay">缃戝叧瀵硅薄</param>
         /// <param name="online">鍦ㄧ嚎鐘舵�佸彉鏇村悗鐨勭姸鎬�</param>
-        public override void GatewayOnlinePush(ZbGateway gateWay, bool online)
+        /// <param name="hadGwOnline">2020.05.25杩藉姞:姝や綇瀹呮槸鍚︽嫢鏈夌綉鍏冲湪绾�</param>
+        public override void GatewayOnlinePush(ZbGateway gateWay, bool online, bool hadGwOnline)
         {
             Application.RunOnMainThread(() =>
             {
@@ -358,10 +360,10 @@
                 {
                     return;
                 }
-                string gwid = HdlGatewayLogic.Current.GetGatewayId(gateWay);
+                string gwid = gateWay.GwId;
                 if (this.dicRowContr.ContainsKey(gwid) == true && this.dicRowContr[gwid] != null)
                 {
-                    this.dicRowContr[gwid].RefreshControl(gateWay);
+                    this.dicRowContr[gwid].IsOnline = online;
                 }
             });
         }
@@ -388,7 +390,7 @@
                     continue;
                 }
                 //鑾峰彇鏈�鏂扮増鏈�
-                var result = await HdlGatewayLogic.Current.GetGatewayAllNewVersion(way, ShowErrorMode.NO);
+                var result = HdlGatewayLogic.Current.GetGatewayAllNewVersion(way, ShowErrorMode.NO);
                 if (result == null)
                 {
                     continue;
@@ -396,8 +398,8 @@
                 if (result[0] != null || result[1] != null || result[2] != null)
                 {
                     //鏈夋柊鐗堟湰
-                    string gwid = HdlGatewayLogic.Current.GetGatewayId(way);
-                    Application.RunOnMainThread(() =>
+                    string gwid = way.GwId;
+                    HdlThreadLogic.Current.RunMain(() =>
                     {
                         if (this.dicRowContr.ContainsKey(gwid) == true && this.dicRowContr[gwid] != null)
                         {

--
Gitblit v1.8.0