From fe3b2466c68b5db70d38e78039703add3b8b1dfe Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期四, 31 十二月 2020 19:29:43 +0800
Subject: [PATCH] 合并了代码

---
 ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs |   45 +++++++++++++++++++++++----------------------
 1 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs
index 1973ec7..083fb29 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs
@@ -95,7 +95,7 @@
 
             //璁惧绫诲瀷 (鍥哄畾鏅鸿兘缃戝叧)
             caption = Language.StringByID(R.MyInternationalizationString.uDeviceType);
-            var infoContent = HdlDeviceCommonLogic.Current.GetDeviceModelIdNameInfo("1");
+            var infoContent = Common.LocalDevice.Current.GetDeviceModelIdNameInfo("1");
             var btnType = new FrameCaptionViewControl(caption, infoContent != null ? infoContent.A绫诲瀷鍚嶅瓧 : string.Empty, listview.rowSpace / 2);
             btnType.UseClickStatu = false;
             listview.AddChidren(btnType);
@@ -130,15 +130,14 @@
             btnBeloneArea.AddBottomLine();
 
             //mini缃戝叧鏈変釜鍔熻兘璁剧疆
-            var linuxImageType = this.zbGateway.LinuxImageType;
-            if (linuxImageType == 11)
+            if (HdlGatewayLogic.Current.IsMiniGateway(this.zbGateway) == true)
             {
-                var listDevice = HdlDeviceCommonLogic.Current.GetDeviceByGatewayID(this.zbGateway.GwId);
+                var listDevice = Common.LocalDevice.Current.GetDeviceByGatewayID(this.zbGateway.GwId);
                 CommonDevice miniDevice = null;
                 foreach (var device in listDevice)
                 {
                     //鑾峰彇杩欎釜缃戝叧涓嬬殑灏忓鐏澶�
-                    if (HdlDeviceCommonLogic.Current.IsMiniLight(device) == true)
+                    if (Common.LocalDevice.Current.IsMiniLight(device) == true)
                     {
                         miniDevice = device;
                         break;
@@ -295,7 +294,7 @@
         private void ShowTopRightMenu()
         {
             //鎼滅储缃戝叧鐨勬椂鍊�,涓嶈兘鍒犻櫎,涓嶇粰浠栧垏鎹�,鍙湁瀹氫綅鍔熻兘
-            bool isSearchGw = HdlFormLogic.Current.IsFormOpen("NewGateWayMenuSelectForm");
+            bool isSearchGw = UserCenterResourse.DicActionForm.ContainsKey("NewGateWayMenuSelectForm");
             int menuCount = isSearchGw == true ? 1 : 3;
 
             bool canAddReplaceMenu = false;
@@ -314,7 +313,7 @@
                 && Common.Config.Instance.Home.IsShowTemplate == false
                 && Common.Config.Instance.Home.IsVirtually == false)
             {
-                //menuCount++;
+                menuCount++;
             }
             var frame = new TopRightMenuControl(menuCount, 1);
             //瀹氫綅
@@ -331,7 +330,7 @@
                 //鍒囨崲
                 MenuName = Language.StringByID(R.MyInternationalizationString.uSwitch1);
                 string strWayId = this.zbGateway.GwId;
-                if (strWayId == HdlGatewayResourse.AppOldSelectGatewayId)
+                if (strWayId == GatewayResourse.AppOldSelectGatewayId)
                 {
                     MenuName = Language.StringByID(R.MyInternationalizationString.uRefresh);
                 }
@@ -340,7 +339,7 @@
                     string nameValue = HdlGatewayLogic.Current.GetGatewayName(zbGateway);
                     //鏄惁鍒囨崲鍒皗0}缃戝叧?
                     string msg = string.Format(Language.StringByID(R.MyInternationalizationString.uConfirmWantToSwitchTheGateway), "[" + nameValue + "]");
-                    if (strWayId == HdlGatewayResourse.AppOldSelectGatewayId)
+                    if (strWayId == GatewayResourse.AppOldSelectGatewayId)
                     {
                         //鏄惁閲嶆柊鍒锋柊{0}缃戝叧?
                         msg = string.Format(Language.StringByID(R.MyInternationalizationString.uConfirmWantToRefreshTheGateway), "[" + nameValue + "]");
@@ -370,14 +369,16 @@
                     });
                 });
             }
-            //if (canAddReplaceMenu == true)
-            //{
-            //    //鏇挎崲
-            //    MenuName = Language.StringByID(R.MyInternationalizationString.uReplace);
-            //    frame.AddRowMenu(MenuName, null, "Item/ReplaceIconSelected.png", () =>
-            //    {
-            //    });
-            //}
+            if (canAddReplaceMenu == true)
+            {
+                //鏇挎崲
+                MenuName = Language.StringByID(R.MyInternationalizationString.uReplace);
+                frame.AddRowMenu(MenuName, null, "Item/ReplaceIconSelected.png", () =>
+                {
+                    var form = new GatewayReplaceForm();
+                    form.AddForm(this.zbGateway);
+                });
+            }
         }
         #endregion
 
@@ -454,13 +455,13 @@
                 this.CloseForm();
 
                 //鍏抽棴鎸囧畾鐣岄潰(缃戝叧鎼滅储)
-                HdlFormLogic.Current.CloseFormByFormName("GatewaySearchListForm");
-                HdlFormLogic.Current.CloseFormByFormName("NewGateWayMenuSelectForm");
+                this.CloseFormByFormName("GatewaySearchListForm");
+                this.CloseFormByFormName("NewGateWayMenuSelectForm");
 
                 //鍏抽棴鎸囧畾鐣岄潰(缃戝叧缂栬緫)
-                HdlFormLogic.Current.CloseFormByFormName("GatewayListForm");
+                this.CloseFormByFormName("GatewayListForm");
 
-                if (HdlFormLogic.Current.IsFormOpen("DeviceListMainForm") == false)
+                if (UserCenterResourse.DicActionForm.ContainsKey("DeviceListMainForm") == false)
                 {
                     //鍒锋柊涓荤敾闈�
                     var form = new Device.DeviceListMainForm();
@@ -499,7 +500,7 @@
                     return;
                 }
 
-                if (strWayId == HdlGatewayResourse.AppOldSelectGatewayId)
+                if (strWayId == GatewayResourse.AppOldSelectGatewayId)
                 {
                     HdlGatewayLogic.Current.SaveGatewayIdToLocation(string.Empty);
                 }

--
Gitblit v1.8.0