From 944b87b6bcccb095cd73f13f4410fb20faf48f74 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期三, 25 十二月 2019 11:21:06 +0800
Subject: [PATCH] 2019.12.25

---
 ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayListForm.cs |   83 ++++++++++++++++++++++-------------------
 1 files changed, 45 insertions(+), 38 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayListForm.cs
index 8a6a8e7..15f6ba8 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayListForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayListForm.cs
@@ -88,19 +88,7 @@
             if (listway.Count == 0)
             {
                 //杩樻病鏈夌粦瀹氱綉鍏冲摝
-                var btnPic = new PicViewControl(683, 392);
-                btnPic.UnSelectedImagePath = "Item/NoFunction.png";
-                btnPic.Y = (int)(bodyFrameLayout.Height * 0.382) - Application.GetRealHeight(392 / 2);
-                btnPic.Gravity = Gravity.CenterHorizontal;
-                bodyFrameLayout.AddChidren(btnPic);
-
-                var btnView = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(50), false);
-                btnView.Y = btnPic.Bottom + Application.GetRealHeight(32);
-                btnView.TextID = R.MyInternationalizationString.uHadNotBindGatewayMsg;
-                btnView.TextAlignment = TextAlignment.Center;
-                btnView.TextSize = 12;
-                btnView.TextColor = UserCenterColor.Current.TextGrayColor1;
-                bodyFrameLayout.AddChidren(btnView);
+                this.ShowNotDataImage(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uHadNotBindGatewayMsg));
                 return;
             }
 
@@ -114,8 +102,6 @@
             //璋冩暣鍒楄〃鎺т欢鐨勯珮搴�
             this.listview.AdjustRealHeight(Application.GetRealHeight(23));
 
-            //璁剧疆鎺ュ彈鍦ㄧ嚎鐘舵�佹帹閫�
-            this.AddGatewayOnlinePush();
             //寮�鍚綉鍏冲湪绾跨洃娴嬬殑绾跨▼
             this.StartGatewayOnlieCheckThread(listway);
         }
@@ -177,8 +163,11 @@
                 }
                 this.ShowMassage(ShowMsgType.Confirm, msg, () =>
                 {
-                    //鎵ц鍒囨崲缃戝叧鎿嶄綔
-                    this.DoSwitchGateway(strWayId);
+                    HdlThreadLogic.Current.RunThread(() =>
+                    {
+                        //鎵ц鍒囨崲缃戝叧鎿嶄綔
+                        this.DoSwitchGateway(strWayId);
+                    });
                 });
             };
 
@@ -214,7 +203,10 @@
                 }
                 this.ShowMassage(ShowMsgType.Confirm, msg, () =>
                 {
-                    this.DeleteGateway(strWayId, gatewayRow);
+                    HdlThreadLogic.Current.RunThread(() =>
+                    {
+                        this.DeleteGateway(strWayId, gatewayRow);
+                    });
                 });
             };
 
@@ -224,6 +216,16 @@
             {
                 HdlGatewayLogic.Current.SaveGatewayIdToLocation(strWayId);
             }
+
+            //褰撳墠缃戝叧鐨勮鏍�
+            //if (strWayId == GatewayResourse.AppOldSelectGatewayId)
+            //{
+            //    var btnNow = new IconViewControl(52);
+            //    btnNow.Y = Application.GetMinReal(23) + gatewayRow.frameTable.chidrenYaxis;
+            //    btnNow.UnSelectedImagePath = "Item/NowAcctionTip.png";
+            //    btnNow.X = gatewayRow.btnName.X + gatewayRow.btnName.GetRealWidthByText(15);
+            //    gatewayRow.frameTable.AddChidren(btnNow, ChidrenBindMode.BindEventOnly);
+            //}
         }
 
         #endregion
@@ -237,8 +239,12 @@
         /// <param name="row"></param>
         private async void DeleteGateway(string strWayId, GatewayRowControl row)
         {
+            //鎵撳紑杩涘害鏉�
+            this.ShowProgressBar();
             //鍒犻櫎浜戠缃戝叧
             bool result = await HdlGatewayLogic.Current.DeleteGateway(strWayId);
+            //鍏抽棴杩涘害鏉�
+            this.CloseProgressBar();
             if (result == false)
             {
                 return;
@@ -250,13 +256,11 @@
                 this.closeDeviceManagForm = true;
                 HdlGatewayLogic.Current.SaveGatewayIdToLocation(string.Empty);
             }
-
-            //绉婚櫎
-            if (this.dicRowContr.ContainsKey(strWayId) == true)
+            HdlThreadLogic.Current.RunMain(() =>
             {
-                this.dicRowContr.Remove(strWayId);
-            }
-            row?.RemoveFromParent();
+                //鍒濆鍖栦腑閮ㄦ帶浠�
+                this.InitMiddleFrame();
+            });
         }
 
         #endregion
@@ -278,19 +282,22 @@
             //濡傛灉閫夋嫨浜嗗埛鏂扮殑缃戝叧锛屽垯涓嶅叧闂鐞嗙晫闈�
             this.closeDeviceManagForm = false;
 
-            if (UserCenterResourse.DicActionForm.ContainsKey("DeviceListMainForm") == false)
+            HdlThreadLogic.Current.RunMain(() =>
             {
-                //鍒锋柊涓荤敾闈�
-                var form = new Device.DeviceListMainForm();
-                this.AddFromAndRemoveNowForm(form);
-            }
-            else
-            {
-                //鍏抽棴鐣岄潰
-                this.CloseForm();
-                //鍒锋柊涓荤敾闈�(涓嶉噸鏂拌幏鍙栬澶囩姸鎬�)
-                this.LoadFormMethodByName("DeviceListMainForm", "InitMiddleFrame", false);
-            }
+                if (UserCenterResourse.DicActionForm.ContainsKey("DeviceListMainForm") == false)
+                {
+                    //鍒锋柊涓荤敾闈�
+                    var form = new Device.DeviceListMainForm();
+                    this.AddFromAndRemoveNowForm(form);
+                }
+                else
+                {
+                    //鍏抽棴鐣岄潰
+                    this.CloseForm();
+                    //鍒锋柊涓荤敾闈�(涓嶉噸鏂拌幏鍙栬澶囩姸鎬�)
+                    this.LoadFormMethodByName("DeviceListMainForm", "InitMiddleFrame", false);
+                }
+            });
         }
 
         #endregion
@@ -412,9 +419,9 @@
         /// <summary>
         /// 鐢婚潰鍏抽棴
         /// </summary>
-        public override void CloseForm()
+        public override void CloseFormBefore()
         {
-            base.CloseForm();
+            base.CloseFormBefore();
 
             if (this.closeDeviceManagForm == true)
             {

--
Gitblit v1.8.0