From 7e863a33397f317ffc3ffd9288496d0e4f16aa66 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期四, 12 十二月 2019 14:58:20 +0800
Subject: [PATCH] 合并了新代码

---
 ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/NewGateWayMenuSelectForm.cs |  100 ++++++++++++--------------------------------------
 1 files changed, 24 insertions(+), 76 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/NewGateWayMenuSelectForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/NewGateWayMenuSelectForm.cs
index 649569b..36dee6e 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/NewGateWayMenuSelectForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/NewGateWayMenuSelectForm.cs
@@ -42,6 +42,11 @@
             row1.AddBottomLine();
             row1.ButtonClickEvent += (sender, e) =>
             {
+                //妫�娴嬩綇瀹呯粡绾害
+                if (this.CheckResidencePoint() == false)
+                {
+                    return;
+                }
                 var form = new WiredGatewayDirectionForm();
                 form.AddForm();
             };
@@ -56,6 +61,11 @@
             row2.AddRightArrow();
             row2.ButtonClickEvent += (sender, e) =>
             {
+                //妫�娴嬩綇瀹呯粡绾害
+                if (this.CheckResidencePoint() == false)
+                {
+                    return;
+                }
                 var menuContr = new BottomMenuSelectForm();
                 menuContr.AddForm(2);
                 //UDP妯″紡(鎺ㄨ崘)
@@ -71,89 +81,27 @@
                     form.AddForm();
                 });
             };
-        }
-
+        }
+
         /// <summary>
-        /// 鑿滃崟鎺т欢
+        /// 妫�娴嬩綇瀹呯粡绾害
         /// </summary>
-        private class SearchWirelessMenuControl : DialogCommonForm
+        /// <returns></returns>
+        private bool CheckResidencePoint()
         {
-            /// <summary>
-            /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
-            /// </summary>
-            public void ShowForm()
+            if (Common.Config.Instance.Home.Latitude == 0 && Common.Config.Instance.Home.Longitude == 0)
             {
-                var frameBack1 = new FrameLayoutControl();
-                frameBack1.UseClickStatu = false;
-                frameBack1.Y = Application.GetRealHeight(1420);
-                frameBack1.Gravity = Gravity.CenterHorizontal;
-                frameBack1.Radius = 12;
-                frameBack1.Width = Application.GetRealWidth(1034);
-                frameBack1.Height = Application.GetRealHeight(300);
-                frameBack1.BackgroundColor = UserCenterColor.Current.White;
-                bodyFrameLayout.AddChidren(frameBack1);
-
-                //UDP妯″紡(鎺ㄨ崘)
-                var btnUdp = new NormalViewControl(900, 156, true);
-                btnUdp.Gravity = Gravity.CenterHorizontal;
-                btnUdp.TextAlignment = TextAlignment.Center;
-                btnUdp.TextColor = 0xff0075ff;
-                btnUdp.TextSize = 17;
-                btnUdp.TextID = R.MyInternationalizationString.uUdpModeRecommend;
-                frameBack1.AddChidren(btnUdp, ChidrenBindMode.NotBind);
-                btnUdp.ButtonClickEvent += (sender, e) =>
+                //璇峰墠寰�浣忓畢绠$悊{0}璁剧疆浣忓畢鐨勫湴鐞嗕綅缃�
+                string msg = Language.StringByID(R.MyInternationalizationString.uGotoResidenceAndSetLocation).Replace("{0}", "\r\n");
+                this.ShowMassage(ShowMsgType.Confirm, msg, () =>
                 {
-                    //鍏抽棴鐣岄潰
-                    this.CloseForm();
-                    var form = new WirelessUdpDirectionForm();
-                    form.AddForm();
-                };
+                    var form = new Residence.ResidenceManagementForm();
+                    form.AddForm(false);
 
-                //绾�
-                var btnLine = new NormalViewControl(frameBack1.Width, ControlCommonResourse.BottomLineHeight, false);
-                btnLine.BackgroundColor = UserCenterColor.Current.ButtomLine;
-                btnLine.Y = btnUdp.Bottom;
-                frameBack1.AddChidren(btnLine, ChidrenBindMode.NotBind);
-                //AP妯″紡
-                var btnAp = new NormalViewControl(900, 144, true);
-                btnAp.Y = btnLine.Bottom;
-                btnAp.Gravity = Gravity.CenterHorizontal;
-                btnAp.TextAlignment = TextAlignment.Center;
-                btnAp.TextColor = 0xff0075ff;
-                btnAp.TextSize = 17;
-                btnAp.TextID = R.MyInternationalizationString.uApMode;
-                frameBack1.AddChidren(btnAp, ChidrenBindMode.NotBind);
-                btnAp.ButtonClickEvent += (sender, e) =>
-                {
-                    //鍏抽棴鐣岄潰
-                    this.CloseForm();
-                    var form = new WirelessApDirection1Form();
-                    form.AddForm();
-                };
-
-                var frameBack2 = new FrameLayoutControl();
-                frameBack2.UseClickStatu = false;
-                frameBack2.Y = frameBack1.Bottom + Application.GetRealHeight(23);
-                frameBack2.Gravity = Gravity.CenterHorizontal;
-                frameBack2.Radius = 12;
-                frameBack2.Width = Application.GetRealWidth(1034);
-                frameBack2.Height = Application.GetRealHeight(156);
-                frameBack2.BackgroundColor = UserCenterColor.Current.White;
-                bodyFrameLayout.AddChidren(frameBack2);
-                //鍙栨秷
-                var btnCancel = new NormalViewControl(900, 156, true);
-                btnCancel.Gravity = Gravity.CenterHorizontal;
-                btnCancel.TextAlignment = TextAlignment.Center;
-                btnCancel.TextColor = 0xff0075ff;
-                btnCancel.TextSize = 17;
-                btnCancel.TextID = R.MyInternationalizationString.uCancel;
-                frameBack2.AddChidren(btnCancel, ChidrenBindMode.NotBind);
-                btnCancel.ButtonClickEvent += (sender, e) =>
-                {
-                    //鍏抽棴鐣岄潰
-                    this.CloseForm();
-                };
+                }, Language.StringByID(R.MyInternationalizationString.uGotoSettion));
+                return false;
             }
+            return true;
         }
     }
 }

--
Gitblit v1.8.0