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/MainPage/DeviceDetailInfoForm.cs | 37 +++++++++++++++++++------------------ 1 files changed, 19 insertions(+), 18 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/MainPage/DeviceDetailInfoForm.cs b/ZigbeeApp/Shared/Phone/MainPage/DeviceDetailInfoForm.cs index 8bec1a6..38fdbec 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/DeviceDetailInfoForm.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/DeviceDetailInfoForm.cs @@ -17,13 +17,13 @@ /// <summary> /// 鐣岄潰鍏抽棴浜嬩欢(璇ヤ簨浠剁洰鍓嶇粰鍒嗙被鐣岄潰鐨勮嚜瀹氫箟琛屾帶浠朵娇鐢�) /// </summary> - public Action<CommonDevice, Room> FormCloseEvent = null; + public Action FormCloseEvent = null; /// <summary> /// 璁惧瀵硅薄 /// </summary> private CommonDevice device; /// <summary> - /// 鎴块棿瀵硅薄(杩欎釜鎴块棿鏈夊彲鑳芥槸鍠滅埍) + /// 鎴块棿瀵硅薄(杩欎釜鎴块棿鏈夊彲鑳芥槸鍠滅埍,鏈夊彲鑳芥槸null) /// </summary> private Room room = null; /// <summary> @@ -49,7 +49,7 @@ base.SetTitleText(Language.StringByID(R.MyInternationalizationString.FunctionSetting)); //涓讳汉鍜岀鐞嗗憳鎵嶈兘鏇存敼 - if (UserCenterResourse.UserInfo.AuthorityNo == 1 || UserCenterResourse.UserInfo.AuthorityNo == 2) + if (HdlUserCenterResourse.ResidenceOption.AuthorityNo == 1 || HdlUserCenterResourse.ResidenceOption.AuthorityNo == 2) { //鍒濆鍖栦腑閮ㄦ帶浠�(涓讳汉,绠$悊鍛�) this.InitMiddleFrameByAdmin(); @@ -100,26 +100,27 @@ }; //璁惧鎵�灞炵被鍨� - var infoType = LocalDevice.Current.GetDeviceBelongEnumInfo(device); + var infoType = HdlDeviceCommonLogic.Current.GetDeviceBelongEnumInfo(device); var btnBelongType = new NormalViewControl(700, 62, true); btnBelongType.Y = btnPic.Bottom + Application.GetRealHeight(35); btnBelongType.Gravity = Gravity.CenterHorizontal; - btnBelongType.TextID = infoType.BeloneTextId; + btnBelongType.Text = infoType.BeloneText; btnBelongType.TextSize = 15; btnBelongType.TextAlignment = TextAlignment.Center; listBackControl.frameTable.AddChidren(btnBelongType); //鍔熻兘鍚嶇О string caption = Language.StringByID(R.MyInternationalizationString.FunctionName); - string deviceName = LocalDevice.Current.GetDeviceEpointName(device); + string deviceName = HdlDeviceCommonLogic.Current.GetDeviceEpointName(device); var btnNote = new FrameCaptionInputControl(caption, deviceName, listview.rowSpace / 2); + btnNote.txtInput.MaxByte = 48;//闄愬埗鍙兘杈撳叆48涓瓧鑺� listview.AddChidren(btnNote); btnNote.InitControl(); //鍒掔嚎 btnNote.AddBottomLine(); btnNote.txtInput.FinishInputEvent += () => { - string oldName = LocalDevice.Current.GetDeviceEpointName(device); + string oldName = HdlDeviceCommonLogic.Current.GetDeviceEpointName(device); if (btnNote.Text == string.Empty) { btnNote.Text = oldName; @@ -132,7 +133,7 @@ }; //鍠滅埍鎴块棿涓嶅厑璁稿彉鏇村尯鍩� - if (this.room.IsLove == false) + if (this.room == null || this.room.IsLove == false) { //鎵�灞炲尯鍩� var rowBeloneArea = new BelongAreaControl(listview.rowSpace / 2); @@ -150,7 +151,7 @@ //鎵�灞炴ā鍧� caption = Language.StringByID(R.MyInternationalizationString.BelongDevice); - deviceName = Common.LocalDevice.Current.GetDeviceMacName(device); + deviceName = HdlDeviceCommonLogic.Current.GetDeviceMacName(device); var rowBelongModul = new FrameCaptionViewControl(caption, deviceName, listview.rowSpace / 2); listview.AddChidren(rowBelongModul); rowBelongModul.InitControl(); @@ -170,7 +171,7 @@ bodyFrameLayout.AddChidren(btnFinish); btnFinish.ButtonClickEvent += (sender, e) => { - string oldName = LocalDevice.Current.GetDeviceEpointName(device); + string oldName = HdlDeviceCommonLogic.Current.GetDeviceEpointName(device); if (btnNote.Text.Trim() == string.Empty) { btnNote.Text = oldName; @@ -212,18 +213,18 @@ btnPic.InitControl(device.DeviceAddr, device.DeviceEpoint); //璁惧鎵�灞炵被鍨� - var infoType = LocalDevice.Current.GetDeviceBelongEnumInfo(device); + var infoType = HdlDeviceCommonLogic.Current.GetDeviceBelongEnumInfo(device); var btnBelongType = new NormalViewControl(700, 62, true); btnBelongType.Y = btnPic.Bottom + Application.GetRealHeight(35); btnBelongType.Gravity = Gravity.CenterHorizontal; - btnBelongType.TextID = infoType.BeloneTextId; + btnBelongType.Text = infoType.BeloneText; btnBelongType.TextSize = 15; btnBelongType.TextAlignment = TextAlignment.Center; listBackControl.frameTable.AddChidren(btnBelongType); //鍔熻兘鍚嶇О string caption = Language.StringByID(R.MyInternationalizationString.FunctionName); - string nameValue = LocalDevice.Current.GetDeviceEpointName(device); + string nameValue = HdlDeviceCommonLogic.Current.GetDeviceEpointName(device); var btnNote = new FrameCaptionViewControl(caption, nameValue, listview.rowSpace / 2); btnNote.UseClickStatu = false; listview.AddChidren(btnNote); @@ -232,7 +233,7 @@ btnNote.AddBottomLine(); //鍠滅埍鎴块棿涓嶅厑璁稿嚭鐜板尯鍩� - if (this.room.IsLove == false) + if (this.room == null || this.room.IsLove == false) { //鎵�灞炲尯鍩� caption = Language.StringByID(R.MyInternationalizationString.uBelongArea); @@ -247,7 +248,7 @@ //鎵�灞炴ā鍧� caption = Language.StringByID(R.MyInternationalizationString.BelongDevice); - nameValue = Common.LocalDevice.Current.GetDeviceMacName(device); + nameValue = HdlDeviceCommonLogic.Current.GetDeviceMacName(device); var rowBelongModul = new FrameCaptionViewControl(caption, nameValue, listview.rowSpace / 2); rowBelongModul.UseClickStatu = false; listview.AddChidren(rowBelongModul); @@ -314,11 +315,11 @@ /// 璁惧閲嶅懡鍚� /// </summary> /// <param name="i_deviceName">deviceName.</param> - private async void DeviceReName(string i_deviceName, bool closeForm) + private void DeviceReName(string i_deviceName, bool closeForm) { //淇敼MAC鍚� string deviceName = i_deviceName.Trim(); - var result = await LocalDevice.Current.ReName(this.device, deviceName); + var result = HdlDeviceCommonLogic.Current.ReName(this.device, deviceName); if (result == false) { return; @@ -345,7 +346,7 @@ /// </summary> public override void CloseFormBefore() { - this.FormCloseEvent?.Invoke(this.device, this.room); + this.FormCloseEvent?.Invoke(); this.FormCloseEvent = null; base.CloseFormBefore(); -- Gitblit v1.8.0