HDL Home App 第二版本 旧平台金堂用 正在使用
黄学彪
2020-12-14 e90209beae6a4e822cecb18e6889f8bda23f630e
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayReplaceListForm.cs
File was renamed from ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayReplaceForm.cs
@@ -3,7 +3,7 @@
using System.Text;
using ZigBee.Device;
namespace Shared.Phone.UserCenter.Gateway
namespace Shared.Phone.UserCenter.GatewayManage
{
    /// <summary>
    /// 网关替换界面
@@ -158,12 +158,13 @@
                //底线
                frameRow.AddBottomLine();
            }
            btnSelect.ButtonClickEvent += (sender, e) =>
            frameRow.ButtonClickEvent += (sender, e) =>
            {
                if (this.btnSelectIcon != null) { this.btnSelectIcon.IsSelected = false; }
                if (this.btnSelectIcon != null) { this.btnSelectIcon.Visible = false; }
                btnSelect.IsSelected = true;
                btnSelect.Visible = true;
                this.btnSelectIcon = btnSelect;
                this.btnSelectIcon.MainKey = localWay.GwId;
                this.btnConfirm.CanClick = true;
            };
        }
@@ -177,6 +178,24 @@
        /// </summary>
        private void DoReplaceGateway()
        {
            if (this.btnSelectIcon == null) { return; }
            ZbGateway realGateway = null;
            if (HdlGatewayLogic.Current.GetRealGateway(ref realGateway, this.nowZbGateway.GwId) == false)
            {
                //错误:网关对象丢失
                HdlMessageLogic.Current.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.uErrorGatewayLostMsg));
                return;
            }
            var targetGw = HdlGatewayLogic.Current.GetLocalGateway(this.btnSelectIcon.MainKey);
            //确认替换掉网关:{0}?
            string msg = Language.StringByID(R.MyInternationalizationString.uReplaceGatewayConfirmMsg).Replace("{0}", HdlGatewayLogic.Current.GetGatewayName(targetGw));
            this.ShowMassage(ShowMsgType.Confirm, msg, () =>
            {
                var form = new GatewayReplaceBackUpListForm();
                form.AddForm(realGateway, this.btnSelectIcon.MainKey);
            });
        }
        #endregion