From 9f326f4000847e6167d8166fa2f6a66f53cb3734 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期四, 17 十二月 2020 09:07:13 +0800 Subject: [PATCH] 新云端Ver1.3 --- ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs | 125 +++++++++++++++++++++++++---------------- 1 files changed, 77 insertions(+), 48 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs index 8236ea9..1973ec7 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs @@ -70,6 +70,7 @@ string caption = Language.StringByID(R.MyInternationalizationString.uDeviceNote); string nameValue = HdlGatewayLogic.Current.GetGatewayName(zbGateway); var btnNote = new FrameCaptionInputControl(caption, nameValue, listview.rowSpace / 2); + btnNote.txtInput.MaxByte = 32;//闄愬埗鍙兘杈撳叆32涓瓧鑺� listview.AddChidren(btnNote); btnNote.InitControl(); //鍒掔嚎 @@ -94,7 +95,7 @@ //璁惧绫诲瀷 (鍥哄畾鏅鸿兘缃戝叧) caption = Language.StringByID(R.MyInternationalizationString.uDeviceType); - var infoContent = Common.LocalDevice.Current.GetDeviceModelIdNameInfo("1"); + var infoContent = HdlDeviceCommonLogic.Current.GetDeviceModelIdNameInfo("1"); var btnType = new FrameCaptionViewControl(caption, infoContent != null ? infoContent.A绫诲瀷鍚嶅瓧 : string.Empty, listview.rowSpace / 2); btnType.UseClickStatu = false; listview.AddChidren(btnType); @@ -111,7 +112,7 @@ rowBeloneArea.SelectRoomEvent += (roomKeys) => { //鍙樻洿缃戝叧鎴块棿 - HdlGatewayLogic.Current.ChangedGatewayRoom(this.zbGateway.GwId, roomKeys); + HdlRoomLogic.Current.ChangedGatewayRoom(this.zbGateway.GwId, roomKeys); }; //濡傛灉鏄睍绀烘ā鏉跨殑璇�,涓嶈兘缂栬緫 if (Common.Config.Instance.Home.IsShowTemplate == true) @@ -132,12 +133,12 @@ var linuxImageType = this.zbGateway.LinuxImageType; if (linuxImageType == 11) { - var listDevice = Common.LocalDevice.Current.GetDeviceByGatewayID(this.zbGateway.GwId); + var listDevice = HdlDeviceCommonLogic.Current.GetDeviceByGatewayID(this.zbGateway.GwId); CommonDevice miniDevice = null; foreach (var device in listDevice) { //鑾峰彇杩欎釜缃戝叧涓嬬殑灏忓鐏澶� - if (Common.LocalDevice.Current.IsMiniLight(device) == true) + if (HdlDeviceCommonLogic.Current.IsMiniLight(device) == true) { miniDevice = device; break; @@ -293,8 +294,29 @@ /// </summary> private void ShowTopRightMenu() { - bool flage = UserCenterResourse.DicActionForm.ContainsKey("NewGateWayMenuSelectForm"); - var frame = new TopRightMenuControl(flage == true ? 1 : 3, 1); + //鎼滅储缃戝叧鐨勬椂鍊�,涓嶈兘鍒犻櫎,涓嶇粰浠栧垏鎹�,鍙湁瀹氫綅鍔熻兘 + bool isSearchGw = HdlFormLogic.Current.IsFormOpen("NewGateWayMenuSelectForm"); + int menuCount = isSearchGw == true ? 1 : 3; + + bool canAddReplaceMenu = false; + //鑾峰彇鏈湴缃戝叧 + var listGateway = HdlGatewayLogic.Current.GetAllLocalGateway(); + foreach (var gw in listGateway) + { + if (gw.GwId != this.zbGateway.GwId && gw.LinuxImageType == this.zbGateway.LinuxImageType) + { + //濡傛灉鏄悓涓�绉嶇被鍨嬬殑缃戝叧,鍏佽鍑虹幇鏇挎崲鑿滃崟 + canAddReplaceMenu = true; + break; + } + } + if (canAddReplaceMenu == true + && Common.Config.Instance.Home.IsShowTemplate == false + && Common.Config.Instance.Home.IsVirtually == false) + { + //menuCount++; + } + var frame = new TopRightMenuControl(menuCount, 1); //瀹氫綅 string MenuName = Language.StringByID(R.MyInternationalizationString.uFixedPosition); frame.AddRowMenu(MenuName, "Item/FixedPosition.png", "Item/FixedPositionSelected.png", () => @@ -302,53 +324,60 @@ //鍙戦�佸畾浣嶅姛鑳� HdlGatewayLogic.Current.SetFixedPositionCommand(zbGateway); }); - if (flage == true) - { - //鎼滅储缃戝叧鐨勬椂鍊�,涓嶈兘鍒犻櫎,涓嶇粰浠栧垏鎹� - return; - } - //鍒囨崲 - MenuName = Language.StringByID(R.MyInternationalizationString.uSwitch1); - string strWayId = this.zbGateway.GwId; - if (strWayId == GatewayResourse.AppOldSelectGatewayId) + //鎼滅储缃戝叧鐨勬椂鍊�,涓嶈兘鍒犻櫎,涓嶇粰浠栧垏鎹� + if (isSearchGw == false) { - MenuName = Language.StringByID(R.MyInternationalizationString.uRefresh); - } - frame.AddRowMenu(MenuName, "Item/GwSwitchIcon.png", "Item/GwSwitchIconSelected.png", () => - { - string nameValue = HdlGatewayLogic.Current.GetGatewayName(zbGateway); - //鏄惁鍒囨崲鍒皗0}缃戝叧? - string msg = string.Format(Language.StringByID(R.MyInternationalizationString.uConfirmWantToSwitchTheGateway), "[" + nameValue + "]"); - if (strWayId == GatewayResourse.AppOldSelectGatewayId) + //鍒囨崲 + MenuName = Language.StringByID(R.MyInternationalizationString.uSwitch1); + string strWayId = this.zbGateway.GwId; + if (strWayId == HdlGatewayResourse.AppOldSelectGatewayId) { - //鏄惁閲嶆柊鍒锋柊{0}缃戝叧? - msg = string.Format(Language.StringByID(R.MyInternationalizationString.uConfirmWantToRefreshTheGateway), "[" + nameValue + "]"); + MenuName = Language.StringByID(R.MyInternationalizationString.uRefresh); } - this.ShowMassage(ShowMsgType.Confirm, msg, () => + frame.AddRowMenu(MenuName, "Item/GwSwitchIcon.png", "Item/GwSwitchIconSelected.png", () => { - HdlThreadLogic.Current.RunThread(() => + string nameValue = HdlGatewayLogic.Current.GetGatewayName(zbGateway); + //鏄惁鍒囨崲鍒皗0}缃戝叧? + string msg = string.Format(Language.StringByID(R.MyInternationalizationString.uConfirmWantToSwitchTheGateway), "[" + nameValue + "]"); + if (strWayId == HdlGatewayResourse.AppOldSelectGatewayId) { - //鎵ц鍒囨崲缃戝叧鎿嶄綔 - this.DoSwitchGateway(); + //鏄惁閲嶆柊鍒锋柊{0}缃戝叧? + msg = string.Format(Language.StringByID(R.MyInternationalizationString.uConfirmWantToRefreshTheGateway), "[" + nameValue + "]"); + } + this.ShowMassage(ShowMsgType.Confirm, msg, () => + { + HdlThreadLogic.Current.RunThread(() => + { + //鎵ц鍒囨崲缃戝叧鎿嶄綔 + this.DoSwitchGateway(); + }); }); }); - }); - //鍒犻櫎 - MenuName = Language.StringByID(R.MyInternationalizationString.uDelete); - frame.AddRowMenu(MenuName, "Item/DeleteIcon2.png", "Item/DeleteIcon2Selected.png", () => - { - //濡傜Щ闄ょ綉鍏筹紝璇ョ綉鍏崇粦瀹氱殑璁惧鍒楄〃{0}灏嗘竻绌猴紝纭缁х画鎵ц璇ユ搷浣滐紵 - string msg = Language.StringByID(R.MyInternationalizationString.uUnBindedMsg); - if (msg.Contains("{0}") == true) + //鍒犻櫎 + MenuName = Language.StringByID(R.MyInternationalizationString.uDelete); + frame.AddRowMenu(MenuName, "Item/DeleteIcon2.png", "Item/DeleteIcon2Selected.png", () => { - msg = string.Format(msg, "\r\n"); - } - this.ShowMassage(ShowMsgType.Confirm, msg, () => - { - this.DeleteGateway(strWayId); + //濡傜Щ闄ょ綉鍏筹紝璇ョ綉鍏崇粦瀹氱殑璁惧鍒楄〃{0}灏嗘竻绌猴紝纭缁х画鎵ц璇ユ搷浣滐紵 + string msg = Language.StringByID(R.MyInternationalizationString.uUnBindedMsg); + if (msg.Contains("{0}") == true) + { + msg = string.Format(msg, "\r\n"); + } + this.ShowMassage(ShowMsgType.Confirm, msg, () => + { + this.DeleteGateway(strWayId); + }); }); - }); + } + //if (canAddReplaceMenu == true) + //{ + // //鏇挎崲 + // MenuName = Language.StringByID(R.MyInternationalizationString.uReplace); + // frame.AddRowMenu(MenuName, null, "Item/ReplaceIconSelected.png", () => + // { + // }); + //} } #endregion @@ -425,13 +454,13 @@ this.CloseForm(); //鍏抽棴鎸囧畾鐣岄潰(缃戝叧鎼滅储) - this.CloseFormByFormName("GatewaySearchListForm"); - this.CloseFormByFormName("NewGateWayMenuSelectForm"); + HdlFormLogic.Current.CloseFormByFormName("GatewaySearchListForm"); + HdlFormLogic.Current.CloseFormByFormName("NewGateWayMenuSelectForm"); //鍏抽棴鎸囧畾鐣岄潰(缃戝叧缂栬緫) - this.CloseFormByFormName("GatewayListForm"); + HdlFormLogic.Current.CloseFormByFormName("GatewayListForm"); - if (UserCenterResourse.DicActionForm.ContainsKey("DeviceListMainForm") == false) + if (HdlFormLogic.Current.IsFormOpen("DeviceListMainForm") == false) { //鍒锋柊涓荤敾闈� var form = new Device.DeviceListMainForm(); @@ -470,7 +499,7 @@ return; } - if (strWayId == GatewayResourse.AppOldSelectGatewayId) + if (strWayId == HdlGatewayResourse.AppOldSelectGatewayId) { HdlGatewayLogic.Current.SaveGatewayIdToLocation(string.Empty); } -- Gitblit v1.8.0