From f2dc339a90467553ef7fe86a8312bdc9d590e420 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期三, 23 九月 2020 09:27:11 +0800
Subject: [PATCH] 更新 DeviceName.ini
---
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs | 94 +++++++++++++++++++++++++++++++---------------
1 files changed, 63 insertions(+), 31 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs
index ce4b49b..8236ea9 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayInfoEditorForm.cs
@@ -74,23 +74,28 @@
btnNote.InitControl();
//鍒掔嚎
btnNote.AddBottomLine();
- btnNote.txtInput.FinishInputEvent += () =>
+ //濡傛灉鏄睍绀烘ā鏉跨殑璇�,涓嶈兘缂栬緫
+ if (Common.Config.Instance.Home.IsShowTemplate == false)
{
- string oldName = HdlGatewayLogic.Current.GetGatewayName(zbGateway);
- if (btnNote.Text == string.Empty)
+ btnNote.txtInput.FinishInputEvent += () =>
{
- btnNote.Text = oldName;
- }
- if (oldName != btnNote.Text)
- {
- //淇敼鍚嶅瓧
- this.SetGatewayName(btnNote.Text, false);
- }
- };
+ string oldName = HdlGatewayLogic.Current.GetGatewayName(zbGateway);
+ if (btnNote.Text == string.Empty)
+ {
+ btnNote.Text = oldName;
+ }
+ if (oldName != btnNote.Text)
+ {
+ //淇敼鍚嶅瓧
+ this.SetGatewayName(btnNote.Text, false);
+ }
+ };
+ }
//璁惧绫诲瀷 (鍥哄畾鏅鸿兘缃戝叧)
caption = Language.StringByID(R.MyInternationalizationString.uDeviceType);
- var btnType = new FrameCaptionViewControl(caption, Language.StringByID(60004), listview.rowSpace / 2);
+ var infoContent = Common.LocalDevice.Current.GetDeviceModelIdNameInfo("1");
+ var btnType = new FrameCaptionViewControl(caption, infoContent != null ? infoContent.A绫诲瀷鍚嶅瓧 : string.Empty, listview.rowSpace / 2);
btnType.UseClickStatu = false;
listview.AddChidren(btnType);
btnType.InitControl();
@@ -108,6 +113,11 @@
//鍙樻洿缃戝叧鎴块棿
HdlGatewayLogic.Current.ChangedGatewayRoom(this.zbGateway.GwId, roomKeys);
};
+ //濡傛灉鏄睍绀烘ā鏉跨殑璇�,涓嶈兘缂栬緫
+ if (Common.Config.Instance.Home.IsShowTemplate == true)
+ {
+ rowBeloneArea.CanClick = false;
+ }
//鎵�灞炰綇瀹�
caption = Language.StringByID(R.MyInternationalizationString.uBelongResidence);
@@ -144,11 +154,15 @@
rowFunction.frameTable.AddRightArrow();
//搴曠嚎
rowFunction.frameTable.AddBottomLine();
- rowFunction.frameTable.ButtonClickEvent += (sender, e) =>
+ //濡傛灉鏄睍绀烘ā鏉跨殑璇�,涓嶈兘缂栬緫
+ if (Common.Config.Instance.Home.IsShowTemplate == false)
{
- var form = new DeviceLight.MiniNightLightFunctionSettionForm();
- form.AddForm(miniDevice);
- };
+ rowFunction.frameTable.ButtonClickEvent += (sender, e) =>
+ {
+ var form = new DeviceLight.MiniNightLightFunctionSettionForm();
+ form.AddForm(miniDevice);
+ };
+ }
}
}
@@ -160,11 +174,15 @@
rowData.frameTable.AddRightArrow();
//搴曠嚎
rowData.frameTable.AddBottomLine();
- rowData.frameTable.ButtonClickEvent += (sender, e) =>
+ //濡傛灉鏄睍绀烘ā鏉跨殑璇�,涓嶈兘缂栬緫
+ if (Common.Config.Instance.Home.IsShowTemplate == false)
{
- var form = new GatewayUploadAndDownLoadForm();
- form.AddForm(this.zbGateway.GwId);
- };
+ rowData.frameTable.ButtonClickEvent += (sender, e) =>
+ {
+ var form = new GatewayUploadAndDownLoadForm();
+ form.AddForm(this.zbGateway.GwId);
+ };
+ }
//閫氱敤淇℃伅
var btnGeneral = new FrameRowControl(listview.rowSpace / 2);
@@ -210,6 +228,11 @@
var btnFinish = new BottomClickButton();
btnFinish.TextID = R.MyInternationalizationString.uSave;
bodyFrameLayout.AddChidren(btnFinish);
+ //濡傛灉鏄睍绀烘ā鏉跨殑璇�,涓嶈兘缂栬緫
+ if (Common.Config.Instance.Home.IsShowTemplate == true)
+ {
+ btnFinish.CanClick = false;
+ }
btnFinish.ButtonClickEvent += (sender, e) =>
{
string oldName = HdlGatewayLogic.Current.GetGatewayName(zbGateway);
@@ -229,11 +252,15 @@
}
};
- HdlThreadLogic.Current.RunThread(() =>
+ //濡傛灉鏄睍绀烘ā鏉跨殑璇�,涓嶉渶瑕佹娴�
+ if (Common.Config.Instance.Home.IsShowTemplate == false)
{
- //妫�娴嬫柊鐗堟湰
- this.CheckNewVersion(btnNewVersion);
- });
+ HdlThreadLogic.Current.RunThread(() =>
+ {
+ //妫�娴嬫柊鐗堟湰
+ this.CheckNewVersion(btnNewVersion);
+ });
+ }
}
#endregion
@@ -245,6 +272,11 @@
/// </summary>
private void InitTopRightMenu()
{
+ //濡傛灉鏄睍绀烘ā鏉跨殑璇�,涓嶈兘缂栬緫
+ if (Common.Config.Instance.Home.IsShowTemplate == true)
+ {
+ return;
+ }
var btnIcon = new MostRightIconControl(69, 69);
btnIcon.UnSelectedImagePath = "Item/More.png";
topFrameLayout.AddChidren(btnIcon);
@@ -329,12 +361,12 @@
private void CheckNewVersion(PicViewControl btnNewVersion)
{
//鑾峰彇缃戝叧鐗堟湰淇℃伅
- var result = HdlGatewayLogic.Current.GetGatewayAllNewVersion(this.zbGateway);
+ var result = HdlGatewayLogic.Current.GetGatewayAllNewVersion(this.zbGateway, ShowErrorMode.NO);
if (result == null)
{
return;
}
- Application.RunOnMainThread(() =>
+ HdlThreadLogic.Current.RunMain(() =>
{
if (this.Parent != null)
{
@@ -344,7 +376,7 @@
btnNewVersion.Visible = true;
}
}
- });
+ }, ShowErrorMode.NO);
}
#endregion
@@ -379,9 +411,9 @@
/// </summary>
/// <param name="gatewayId"></param>
/// <param name="online"></param>
- private async void DoSwitchGateway()
+ private void DoSwitchGateway()
{
- var result = await HdlGatewayLogic.Current.DoSwitchGateway(zbGateway.GwId);
+ var result = HdlGatewayLogic.Current.DoSwitchGateway(zbGateway.GwId);
if (result == false)
{
return;
@@ -424,13 +456,13 @@
/// <param name="row"></param>
private void DeleteGateway(string strWayId)
{
- HdlThreadLogic.Current.RunThread(async () =>
+ HdlThreadLogic.Current.RunThread(() =>
{
//鎵撳紑杩涘害鏉�
this.ShowProgressBar();
//鍒犻櫎浜戠缃戝叧
- bool result = await HdlGatewayLogic.Current.DeleteGateway(strWayId);
+ bool result = HdlGatewayLogic.Current.DeleteGateway(strWayId);
//鍏抽棴杩涘害鏉�
this.CloseProgressBar();
if (result == false)
--
Gitblit v1.8.0