gxc
2020-02-28 66a9965c44ecc32a6696abca876ab9d1cd091584
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayListForm.cs
@@ -88,19 +88,7 @@
            if (listway.Count == 0)
            {
                //还没有绑定网关哦
                var btnPic = new PicViewControl(683, 392);
                btnPic.UnSelectedImagePath = "Item/NoFunction.png";
                btnPic.Y = (int)(bodyFrameLayout.Height * 0.382) - Application.GetRealHeight(392 / 2);
                btnPic.Gravity = Gravity.CenterHorizontal;
                bodyFrameLayout.AddChidren(btnPic);
                var btnView = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(50), false);
                btnView.Y = btnPic.Bottom + Application.GetRealHeight(32);
                btnView.TextID = R.MyInternationalizationString.uHadNotBindGatewayMsg;
                btnView.TextAlignment = TextAlignment.Center;
                btnView.TextSize = 12;
                btnView.TextColor = UserCenterColor.Current.TextGrayColor1;
                bodyFrameLayout.AddChidren(btnView);
                this.ShowNotDataImage(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uHadNotBindGatewayMsg));
                return;
            }
@@ -114,8 +102,6 @@
            //调整列表控件的高度
            this.listview.AdjustRealHeight(Application.GetRealHeight(23));
            //设置接受在线状态推送
            this.AddGatewayOnlinePush();
            //开启网关在线监测的线程
            this.StartGatewayOnlieCheckThread(listway);
        }
@@ -177,8 +163,11 @@
                }
                this.ShowMassage(ShowMsgType.Confirm, msg, () =>
                {
                    //执行切换网关操作
                    this.DoSwitchGateway(strWayId);
                    HdlThreadLogic.Current.RunThread(() =>
                    {
                        //执行切换网关操作
                        this.DoSwitchGateway(strWayId);
                    });
                });
            };
@@ -214,7 +203,10 @@
                }
                this.ShowMassage(ShowMsgType.Confirm, msg, () =>
                {
                    this.DeleteGateway(strWayId, gatewayRow);
                    HdlThreadLogic.Current.RunThread(() =>
                    {
                        this.DeleteGateway(strWayId, gatewayRow);
                    });
                });
            };
@@ -223,6 +215,16 @@
            if (string.IsNullOrEmpty(GatewayResourse.AppOldSelectGatewayId) == true)
            {
                HdlGatewayLogic.Current.SaveGatewayIdToLocation(strWayId);
            }
            //当前网关的角标
            if (strWayId == GatewayResourse.AppOldSelectGatewayId)
            {
                var btnNow = new IconViewControl(52);
                btnNow.Y = Application.GetMinReal(23) + gatewayRow.frameTable.chidrenYaxis;
                btnNow.UnSelectedImagePath = "Item/NowAcctionTip.png";
                btnNow.X = gatewayRow.btnName.X + gatewayRow.btnName.GetRealWidthByText();
                gatewayRow.frameTable.AddChidren(btnNow, ChidrenBindMode.BindEventOnly);
            }
        }
@@ -237,8 +239,12 @@
        /// <param name="row"></param>
        private async void DeleteGateway(string strWayId, GatewayRowControl row)
        {
            //打开进度条
            this.ShowProgressBar();
            //删除云端网关
            bool result = await HdlGatewayLogic.Current.DeleteGateway(strWayId);
            //关闭进度条
            this.CloseProgressBar();
            if (result == false)
            {
                return;
@@ -250,13 +256,11 @@
                this.closeDeviceManagForm = true;
                HdlGatewayLogic.Current.SaveGatewayIdToLocation(string.Empty);
            }
            //移除
            if (this.dicRowContr.ContainsKey(strWayId) == true)
            HdlThreadLogic.Current.RunMain(() =>
            {
                this.dicRowContr.Remove(strWayId);
            }
            row?.RemoveFromParent();
                //初始化中部控件
                this.InitMiddleFrame();
            });
        }
        #endregion
@@ -278,19 +282,22 @@
            //如果选择了刷新的网关,则不关闭管理界面
            this.closeDeviceManagForm = false;
            if (UserCenterResourse.DicActionForm.ContainsKey("DeviceListMainForm") == false)
            HdlThreadLogic.Current.RunMain(() =>
            {
                //刷新主画面
                var form = new Device.DeviceListMainForm();
                this.AddFromAndRemoveNowForm(form);
            }
            else
            {
                //关闭界面
                this.CloseForm();
                //刷新主画面(不重新获取设备状态)
                this.LoadFormMethodByName("DeviceListMainForm", "InitMiddleFrame", false);
            }
                if (UserCenterResourse.DicActionForm.ContainsKey("DeviceListMainForm") == false)
                {
                    //刷新主画面
                    var form = new Device.DeviceListMainForm();
                    this.AddFromAndRemoveNowForm(form);
                }
                else
                {
                    //关闭界面
                    this.CloseForm();
                    //刷新主画面(不重新获取设备状态)
                    this.LoadFormMethodByName("DeviceListMainForm", "InitMiddleFrame", false);
                }
            });
        }
        #endregion
@@ -412,9 +419,9 @@
        /// <summary>
        /// 画面关闭
        /// </summary>
        public override void CloseForm()
        public override void CloseFormBefore()
        {
            base.CloseForm();
            base.CloseFormBefore();
            if (this.closeDeviceManagForm == true)
            {