From 6cbd0936d3245fd7c433884ac9c1f5448a7cf657 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期五, 13 十二月 2019 13:49:44 +0800
Subject: [PATCH] 合并了代码
---
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs | 82 +++++++++++++++++++++++++---------------
1 files changed, 51 insertions(+), 31 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs
index daa441b..a6f7ada 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs
+++ b/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)
@@ -748,7 +757,7 @@
btnNewVersion.UnSelectedImagePath = "Item/NewVersion.png";
btnNewVersion.Visible = false;
btnNewVersion.X = Application.GetRealWidth(242);
- btnNewVersion.Y= Application.GetRealHeight(23);
+ btnNewVersion.Y = Application.GetRealHeight(23);
rowUpDate.AddChidren(btnNewVersion, ChidrenBindMode.BindEventOnly);
rowUpDate.ButtonClickEvent += (sender, e) =>
@@ -818,7 +827,7 @@
/// 璁惧閲嶅懡鍚�
/// </summary>
/// <param name="i_deviceName">deviceName.</param>
- private async void DeviceReName(string i_deviceName,bool closeForm)
+ private async void DeviceReName(string i_deviceName, bool closeForm)
{
//寮�鍚繘搴︽潯
this.ShowProgressBar();
@@ -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
--
Gitblit v1.8.0