From b02e8275a21dc06bf54b66273485d44e007a2616 Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期一, 20 七月 2020 14:50:17 +0800
Subject: [PATCH] 新代码

---
 ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayRebindForm.cs |   73 ++++++++++++++++++++++++++++++++++++
 1 files changed, 73 insertions(+), 0 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayRebindForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayRebindForm.cs
new file mode 100755
index 0000000..eea6e72
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayRebindForm.cs
@@ -0,0 +1,73 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+using ZigBee.Device;
+
+namespace Shared.Phone.UserCenter.GatewayManage
+{
+    /// <summary>
+    /// 閲嶆柊缁戝畾缃戝叧鐨勭晫闈�
+    /// </summary>
+    public class GatewayRebindForm : EditorCommonForm
+    {
+        #region 鈻� 鍙橀噺澹版槑___________________________
+
+        #endregion
+
+        #region 鈻� 鍒濆鍖朹____________________________
+
+        /// <summary>
+        /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
+        /// </summary>
+        /// <param name="i_gateway">鎹㈢粦鐨勭綉鍏冲璞�</param>
+        /// <param name="i_dicZbGatewayDiv">鎼滅储鍒扮殑缃戝叧绫诲埆  0:绗竴娆$粦瀹� 1:宸茬粡缁戝畾 2:闇�瑕佹崲缁�</param>
+        public void ShowForm(ZbGateway i_gateway, Dictionary<string, int> i_dicZbGatewayDiv)
+        {
+            //璁剧疆澶撮儴淇℃伅
+            base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAddGateway));
+
+            var btnLoading = new LoadingControl();
+            btnLoading.Y = Application.GetRealHeight(656);
+            btnLoading.Gravity = Gravity.CenterHorizontal;
+            bodyFrameLayout.AddChidren(btnLoading);
+            btnLoading.StartAction();
+
+            //姝e湪鎹㈢粦缃戝叧锛岃绋嶅�欌��
+            var btnMsg = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false);
+            btnMsg.Y = Application.GetRealHeight(979);
+            btnMsg.TextAlignment = TextAlignment.Center;
+            btnMsg.TextColor = UserCenterColor.Current.TextGrayColor3;
+            btnMsg.TextID = R.MyInternationalizationString.uIsReBindingPleaseWaiting;
+            bodyFrameLayout.AddChidren(btnMsg);
+
+            HdlThreadLogic.Current.RunThread(async () =>
+            {
+                await System.Threading.Tasks.Task.Delay(1000);
+                int value = await HdlGatewayLogic.Current.ReBindNewGateway(i_gateway, btnMsg);
+                if (value == 1)
+                {
+                    //鎴愬姛
+                    i_dicZbGatewayDiv[i_gateway.GwId] = 1;
+                }
+                else if (value == 0)
+                {
+                    //缃戝叧缁戝畾鍦ㄥ綋鍓嶈处鍙蜂笅鐨勫叾浠栦綇瀹呴噷\r\n璇疯В闄ょ粦瀹氬悗鍐嶈瘯
+                    string msg = Language.StringByID(R.MyInternationalizationString.uTheGatewayInOtherResidenceMsg);
+                    if (msg.Contains("{0}") == true)
+                    {
+                        msg = string.Format(msg, "\r\n");
+                    }
+                    this.ShowMassage(ShowMsgType.Tip, msg);
+                }
+
+                HdlThreadLogic.Current.RunMain(() =>
+                {
+                    //鎴愬姛鎴栬�呭け璐ラ兘鍏抽棴鐣岄潰
+                    this.CloseForm();
+                });
+            });
+        }
+
+        #endregion
+    }
+}

--
Gitblit v1.8.0