From dc0309e64f02227d8e1468b7326c07955f804612 Mon Sep 17 00:00:00 2001
From: chenqiyang <1406175257@qq.com>
Date: 星期三, 22 六月 2022 11:22:18 +0800
Subject: [PATCH] 修改引用路径
---
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs | 41 ++++++++++++++++++++++++++++++++++++-----
1 files changed, 36 insertions(+), 5 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs
index a6cb796..a47dd9c 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs
@@ -45,6 +45,9 @@
listNewDevice.Add(Common.LocalDevice.Current.GetOTADevice(deviceMac));
}
+ //娣诲姞鏂拌澶囩殑璇�,涓婚〉闇�瑕侀噸鏂板埛鏂�
+ UserView.UserPage.Instance.RefreshAllForm = true;
+
//璁剧疆鏍囬淇℃伅
base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAddDevice));
@@ -55,6 +58,10 @@
this.SetAllEpointName();
// 璁剧疆缃戝叧鎵�鍦ㄧ殑鏃跺尯鐨勬椂闂寸粰闂ㄩ攣鏃堕棿
this.SetDoorTime();
+ //鏂板叆缃戠殑璁惧,娓呯┖鎺夊畠鐨勬埧闂�
+ this.ClearDeviceFromRoom();
+ //娣诲姞璁惧鐨勬椂鍊�,鍏抽棴宸﹀垝鑿滃崟鐨勬湭鍒嗛厤鐣岄潰
+ MainPage.LeftListRoomViewFrom.Instance?.CloseUnallocatedRoomForm();
}
/// <summary>
@@ -102,6 +109,7 @@
string caption = Language.StringByID(R.MyInternationalizationString.uDeviceNote);
string deviceName = Common.LocalDevice.Current.GetDeviceMacName(listNewDevice[0]);
this.btnNote = new FrameCaptionInputControl(caption, deviceName, listview.rowSpace / 2);
+ this.btnNote.txtInput.MaxByte = 48;//闄愬埗鍙兘杈撳叆48涓瓧鑺�
listview.AddChidren(btnNote);
btnNote.InitControl();
//鍒掔嚎
@@ -167,7 +175,7 @@
}
}
//淇濆瓨璁惧鎴块棿绱㈠紩
- Common.LocalDevice.Current.SaveRealDeviceRoomId(this.listNewDevice, roomKeys);
+ HdlRoomLogic.Current.SaveRealDeviceRoomId(this.listNewDevice, roomKeys);
};
//鏇村閰嶇疆
@@ -179,8 +187,12 @@
btnHelp.Text = Language.StringByID(R.MyInternationalizationString.uMoreSettion);
btnHelp.ButtonClickEvent += (sender, e) =>
{
+ //鏇存敼杩囦竴娆′箣鍚庯紝鍒欑晫闈㈠叧闂悗涓嶅啀鏇存敼
+ this.saveDefultName = string.Empty;
//鏀瑰悕瀛�
btnNote.txtInput.FinishInputEvent();
+
+ this.CloseForm();
var form = new DeviceMacInfoEditorForm();
form.AddForm(this.listNewDevice[0].DeviceAddr);
@@ -235,6 +247,8 @@
detailBackFrame.AddChidren(btnFinish);
btnFinish.MouseUpEventHandler += (sender, e) =>
{
+ //鏇存敼杩囦竴娆′箣鍚庯紝鍒欑晫闈㈠叧闂悗涓嶅啀鏇存敼
+ this.saveDefultName = string.Empty;
//鏀瑰悕瀛�
btnNote.txtInput.FinishInputEvent();
//鍏抽棴鑷韩
@@ -251,11 +265,11 @@
/// </summary>
/// <param name="i_deviceName">deviceName.</param>
/// <param name="mode">鏄惁鏄剧ず閿欒</param>
- private async void DeviceReName(string i_deviceName, ShowErrorMode mode = ShowErrorMode.YES)
+ private void DeviceReName(string i_deviceName, ShowErrorMode mode = ShowErrorMode.YES)
{
//淇敼MAC鍚�
string deviceName = i_deviceName.Trim();
- var result = await Common.LocalDevice.Current.ReMacName(this.listNewDevice, deviceName, mode);
+ var result = Common.LocalDevice.Current.ReMacName(this.listNewDevice, deviceName, mode);
if (result == false)
{
return;
@@ -267,7 +281,7 @@
/// <summary>
/// 璁剧疆鍏ㄩ儴鍥炶矾鐨勯粯璁ゅ悕瀛�
/// </summary>
- private async void SetAllEpointName()
+ private void SetAllEpointName()
{
foreach (var device in this.listNewDevice)
{
@@ -278,7 +292,7 @@
}
//鑾峰彇绔偣鍚嶅瓧
var epointName = Common.LocalDevice.Current.GetDeviceEpointName(device);
- await Common.LocalDevice.Current.ReName(device, epointName, ShowErrorMode.NO);
+ Common.LocalDevice.Current.ReName(device, epointName, ShowErrorMode.NO);
}
}
@@ -302,6 +316,23 @@
#endregion
+ #region 鈻� 涓�鑸柟娉昣__________________________
+
+ /// <summary>
+ /// 鏂板叆缃戠殑璁惧,娓呯┖鎺夊畠鐨勬埧闂�
+ /// </summary>
+ private void ClearDeviceFromRoom()
+ {
+ foreach (var device in this.listNewDevice)
+ {
+ HdlRoomLogic.Current.DeleteDevice(device);
+ HdlRoomLogic.Current.DeleteLoveDevice(device);
+ }
+ HdlRoomLogic.Current.DeleteRealDeviceFromRoom(this.listNewDevice[0]);
+ }
+
+ #endregion
+
#region 鈻� 鐢婚潰鍏抽棴___________________________
/// <summary>
--
Gitblit v1.8.0