From e22fdb94322e6cec38e5e4a9aec13d431a133fde Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期二, 28 四月 2020 16:32:35 +0800 Subject: [PATCH] 上传合并后的代码 --- ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceSearchForm.cs | 41 +++++++++++++++++++++++------------------ 1 files changed, 23 insertions(+), 18 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceSearchForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceSearchForm.cs index 4102a31..e0ea8f3 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceSearchForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceSearchForm.cs @@ -80,7 +80,7 @@ //璁剧疆鏍囬淇℃伅 base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAddDevice)); - this.gatewayId = HdlGatewayLogic.Current.GetGatewayId(GatewayResourse.NowSelectGateway); + this.gatewayId = GatewayResourse.NowSelectGatewayId; HdlGatewayLogic.Current.GetRealGateway(ref this.realGateway, this.gatewayId); //鍒濆鍖栦腑閮ㄦ帶浠� @@ -97,7 +97,7 @@ //鍥剧墖 var btnPic = new PicViewControl(878, 478); - btnPic.Y = Application.GetMinRealAverage(251); + btnPic.Y = Application.GetRealHeight(251); btnPic.Gravity = Gravity.CenterHorizontal; btnPic.UnSelectedImagePath = "Instruct/DeviceSearch.png"; bodyFrameLayout.AddChidren(btnPic); @@ -142,11 +142,13 @@ btnProgressView.Text = "0%"; frameProgress.AddChidren(btnProgressView); - //鍏佽璁惧鍏ョ綉 - this.StartDeviceCanAddToGateway(false); - - //娣诲姞鐩戣璁惧鏂颁笂鎶ョ殑浜嬩欢 - this.realGateway.GwResDataAction += this.AdjustGatewayResultData; + if (this.realGateway != null) + { + //鍏佽璁惧鍏ョ綉 + this.StartDeviceCanAddToGateway(false); + //娣诲姞鐩戣璁惧鏂颁笂鎶ョ殑浜嬩欢 + this.realGateway.GwResDataAction += this.AdjustGatewayResultData; + } //寮�鍚繛鎺ョ殑鍋囨兂鍔ㄧ敾鏁堟灉绾跨▼ this.StartConcetionAnimeteThread(); } @@ -312,20 +314,20 @@ /// </summary> private void StartConcetionAnimeteThread() { - int iconSize = Application.GetMinRealAverage(23); + int iconSize = this.GetPictrueRealSize(23); var listPoint = new List<int>(); for (int i = 0; i < 9; i++) { //X杞�+Index*(鍥炬爣澶у皬+闂磋窛) - listPoint.Add(Application.GetMinRealAverage(394) + i * (iconSize + Application.GetMinRealAverage(10))); + listPoint.Add(this.GetPictrueRealSize(394) + i * (iconSize + this.GetPictrueRealSize(10))); } var btnRound = new PicViewControl(iconSize, iconSize, false); btnRound.Radius = (uint)iconSize / 2; btnRound.BackgroundColor = UserCenterColor.Current.ConcetionRoundColor; btnRound.X = listPoint[0]; - btnRound.Y = Application.GetMinRealAverage(475); + btnRound.Y = this.GetPictrueRealSize(475); bodyFrameLayout.AddChidren(btnRound); HdlThreadLogic.Current.RunThread(() => @@ -571,15 +573,18 @@ /// </summary> public override void CloseFormBefore() { - //鍋滄鎺ユ敹 - this.realGateway.GwResDataAction -= this.AdjustGatewayResultData; - - HdlThreadLogic.Current.RunThread(() => + if (this.realGateway != null) { - System.Threading.Thread.Sleep(1200); - //鍏抽棴鍏ョ綉妯″紡 - this.realGateway.AddNewDeviceToGateway(0); - }); + //鍋滄鎺ユ敹 + this.realGateway.GwResDataAction -= this.AdjustGatewayResultData; + + HdlThreadLogic.Current.RunThread(() => + { + System.Threading.Thread.Sleep(1200); + //鍏抽棴鍏ョ綉妯″紡 + this.realGateway.AddNewDeviceToGateway(0); + }); + } base.CloseFormBefore(); } -- Gitblit v1.8.0