黄学彪
2019-12-09 163777d8a2cb7cfa469f54a7042528870ebc10a3
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs
@@ -257,21 +257,19 @@
                     if (UserCenterResourse.UserInfo.AuthorityNo == 1)
                     {
                         Action action = null;
                         if (!UserCenterResourse.Option.DoorUnLockByRemote)
                         Action actionNone = null;
                         action = () =>
                         {
                             var userManagement = new Shared.Phone.UserCenter.DoorLock.UserManagement(doorLock);
                             Shared.Phone.UserView.HomePage.Instance.AddChidren(userManagement);
                             Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
                             userManagement.Show();
                         };
                         actionNone = () =>
                         {
                             Shared.Phone.UserCenter.DoorLock.DoorLockCommonLayout.SecurityRequest(doorLock, action);
                         }
                         else
                         {
                             action = async () =>
                             {
                                 var userManagement = new Shared.Phone.UserCenter.DoorLock.UserManagement(doorLock);
                                 Shared.Phone.UserView.HomePage.Instance.AddChidren(userManagement);
                                 Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
                                 userManagement.Show();
                             };
                             HdlCheckLogic.Current.CheckSecondarySecurity(action);
                         }
                         };
                         HdlCheckLogic.Current.CheckSecondarySecurity(action, actionNone);
                     }
                     else
                     {
@@ -279,10 +277,21 @@
                         var result = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetDoorLockOperateAccess(doorLock, Shared.Common.Config.Instance.Guid);
                         if (result == false)
                         {
                             var userManagement = new Shared.Phone.UserCenter.DoorLock.UserManagement(doorLock);
                             Shared.Phone.UserView.HomePage.Instance.AddChidren(userManagement);
                             Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
                             userManagement.Show();
                             Action action = null;
                             Action actionNone = null;
                             action = () =>
                             {
                                 var userManagement = new Shared.Phone.UserCenter.DoorLock.UserManagement(doorLock);
                                 Shared.Phone.UserView.HomePage.Instance.AddChidren(userManagement);
                                 Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
                                 userManagement.Show();
                             };
                             actionNone = () =>
                             {
                                 Shared.Phone.UserCenter.DoorLock.DoorLockCommonLayout.SecurityRequest(doorLock, action);
                             };
                             HdlCheckLogic.Current.CheckSecondarySecurity(action, actionNone);
                         }
                         else
                         {
@@ -641,7 +650,7 @@
            //添加属性上报监听
            string mainkeys = LocalDevice.Current.GetDeviceMainKeys(this.listNewDevice[0]);
            HdlDeviceAttributeLogic.Current.AddAttributeEvent("HandPullControl", "DeviceStatusReport", (device) =>
            HdlGatewayReceiveLogic.Current.AddAttributeEvent("HandPullControl", ReceiveComandDiv.A设备属性上报, (device) =>
            {
                string checkKey = LocalDevice.Current.GetDeviceMainKeys(device);
                if (mainkeys != checkKey || device.DeviceStatusReport.CluterID != 258)
@@ -909,16 +918,27 @@
        /// <summary>
        /// 删除指定设备
        /// </summary>
        private async void DoDeleteDevice()
        private void DoDeleteDevice()
        {
            //删除设备
            bool result = await Common.LocalDevice.Current.DeleteDevice(listNewDevice);
            if (result == false)
            HdlThreadLogic.Current.RunThread(async () =>
            {
                return;
            }
            //关闭界面
            this.CloseForm();
                //打开进度条
                this.ShowProgressBar();
                //删除设备
                bool result = await Common.LocalDevice.Current.DeleteDevice(listNewDevice);
                //关闭进度条
                this.CloseProgressBar();
                if (result == false)
                {
                    return;
                }
                HdlThreadLogic.Current.RunMain(() =>
                {
                    //关闭界面
                    this.CloseForm();
                });
            });
        }
        #endregion
@@ -927,13 +947,13 @@
        /// <summary>
        /// 画面关闭
        /// </summary>
        public override void CloseForm()
        public override void CloseFormBefore()
        {
            HdlDeviceAttributeLogic.Current.RemoveEvent("HandPullControl");
            HdlGatewayReceiveLogic.Current.RemoveEvent("HandPullControl");
            //移除获取设备硬件信息的监听线程
            HdlDeviceHardInfoLogic.Current.RemoveDeviceHardInfoThread(listNewDevice[0]);
            base.CloseForm();
            base.CloseFormBefore();
        }
        #endregion