From 9f326f4000847e6167d8166fa2f6a66f53cb3734 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期四, 17 十二月 2020 09:07:13 +0800
Subject: [PATCH] 新云端Ver1.3

---
 ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueButtonSettionForm.cs |   46 ++++++++++++++++++++++++----------------------
 1 files changed, 24 insertions(+), 22 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueButtonSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueButtonSettionForm.cs
index 225a2aa..7070988 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueButtonSettionForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueButtonSettionForm.cs
@@ -87,7 +87,7 @@
             var btnFinish = new BottomClickButton();
             btnFinish.TextID = R.MyInternationalizationString.uSave;
             bodyFrameLayout.AddChidren(btnFinish);
-            btnFinish.ButtonClickEvent += async (sender, e) =>
+            btnFinish.ButtonClickEvent += (sender, e) =>
             {
                 //璁板綍璧峰綋鍓嶆鍦ㄦ搷浣滅殑鍥炶矾鍚嶅瓧
                 dicDeviceSaveName[nowSelectDevice.DeviceEpoint] = btnDeviceName.Text.Trim();
@@ -95,18 +95,18 @@
                 this.ShowProgressBar();
                 foreach (var epoint in dicDeviceSaveName.Keys)
                 {
-                    var device = Common.LocalDevice.Current.GetDevice(deviceObj.DeviceAddr, epoint);
+                    var device = HdlDeviceCommonLogic.Current.GetDevice(deviceObj.DeviceAddr, epoint);
                     if (device == null || dicDeviceSaveName[epoint] == string.Empty)
                     {
                         //涓嶈兘鍏佽绌虹櫧鍚嶅瓧
                         continue;
                     }
                     string newName = dicDeviceSaveName[epoint];
-                    string oldName = Common.LocalDevice.Current.GetDeviceEpointName(device);
+                    string oldName = HdlDeviceCommonLogic.Current.GetDeviceEpointName(device);
                     if (oldName != newName)
                     {
                         //璁惧鍚嶇О淇敼
-                        var result = await Common.LocalDevice.Current.ReName(device, newName);
+                        var result = HdlDeviceCommonLogic.Current.ReName(device, newName);
                         if (result == false)
                         {
                             //鍏抽棴
@@ -128,7 +128,7 @@
         {
             this.listview.RemoveAll();
 
-            string nameValue = Common.LocalDevice.Current.GetDeviceEpointName(nowSelectDevice);
+            string nameValue = HdlDeviceCommonLogic.Current.GetDeviceEpointName(nowSelectDevice);
             if (dicDeviceSaveName.ContainsKey(nowSelectDevice.DeviceEpoint) == true)
             {
                 nameValue = dicDeviceSaveName[nowSelectDevice.DeviceEpoint];
@@ -137,12 +137,13 @@
             //鎸夐敭澶囨敞
             string caption = Language.StringByID(R.MyInternationalizationString.uPanelButtonNote);
             this.btnDeviceName = new FrameCaptionInputControl(caption, nameValue, listview.rowSpace / 2);
+            this.btnDeviceName.txtInput.MaxByte = 48;//闄愬埗鍙兘杈撳叆48涓瓧鑺�
             listview.AddChidren(btnDeviceName);
             btnDeviceName.InitControl();
             btnDeviceName.AddBottomLine();
-            btnDeviceName.txtInput.FinishInputEvent += async () =>
+            btnDeviceName.txtInput.FinishInputEvent += () =>
             {
-                string oldName = Common.LocalDevice.Current.GetDeviceEpointName(nowSelectDevice);
+                string oldName = HdlDeviceCommonLogic.Current.GetDeviceEpointName(nowSelectDevice);
                 if (btnDeviceName.Text.Trim() == string.Empty)
                 {
                     //灏嗗悕瀛楄繕鍘�
@@ -151,7 +152,7 @@
                 if (oldName != btnDeviceName.Text.Trim())
                 {
                     //璁惧鍚嶇О淇敼
-                    var result = await Common.LocalDevice.Current.ReName(nowSelectDevice, btnDeviceName.Text.Trim());
+                    var result = HdlDeviceCommonLogic.Current.ReName(nowSelectDevice, btnDeviceName.Text.Trim());
                     if (result == false)
                     {
                         return;
@@ -193,7 +194,7 @@
         private void InitTopRightMenu()
         {
             //妫�娴嬫鍥炶矾鏄惁鎷ユ湁瀹氫綅鍔熻兘
-            if (Common.LocalDevice.Current.DeviceIsCanFixedPosition(nowSelectDevice) == false)
+            if (HdlDeviceCommonLogic.Current.DeviceIsCanFixedPosition(nowSelectDevice) == false)
             {
                 return;
             }
@@ -219,7 +220,7 @@
             frame.AddRowMenu(deviceMenu, "Item/FixedPosition.png", "Item/FixedPositionSelected.png", () =>
             {
                 //鍙戦�佸畾浣嶅姛鑳�
-                Common.LocalDevice.Current.SetFixedPositionCommand(nowSelectDevice);
+                HdlDeviceCommonLogic.Current.SetFixedPositionCommand(nowSelectDevice);
             });
         }
 
@@ -263,7 +264,7 @@
         private void AddBackLightRow()
         {
             //娌充笢璁惧鎵嶄細寮�鍚閫夐」
-            if (Common.LocalDevice.Current.IsHdlDevice(nowSelectDevice) == true)
+            if (HdlDeviceCommonLogic.Current.IsHdlDevice(nowSelectDevice) == true)
             {
                 //鑳屽厜鐏�
                 string caption = Language.StringByID(R.MyInternationalizationString.uBackLight);
@@ -278,7 +279,7 @@
                 {
                     List<CommonDevice> listNewDevice = new List<CommonDevice> { };
                     listNewDevice.Add((Panel)nowSelectDevice);
-                    var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(listNewDevice);
+                    var deviceEnumInfo = HdlDeviceCommonLogic.Current.GetMyDeviceEnumInfo(listNewDevice);
                     //濡傛灉璁惧鏄柟鎮﹀紑鎺ц澶囷紝鑳屽厜鐏〉闇�瑕佹粦鍔ㄤ笖鏈夋帴杩戞劅搴斿姛鑳�  
                     if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueTwo
                        || deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueFour
@@ -307,7 +308,7 @@
         private void InitDeviceEpointIcon(VerticalFrameControl listBackControl)
         {
             bool hadDevice = false;
-            var listDevice = Common.LocalDevice.Current.GetDevicesByMac(deviceObj.DeviceAddr);
+            var listDevice = HdlDeviceCommonLogic.Current.GetDevicesByMac(deviceObj.DeviceAddr);
             var listOffSwitch = new List<CommonDevice>();
             foreach (var device in listDevice)
             {
@@ -377,12 +378,13 @@
         private NormalViewControl InitDeviceButtonControl(FrameLayout frame, CommonDevice device)
         {
             var btnIcon = new NormalViewControl(this.GetPictrueRealSize(52), this.GetPictrueRealSize(52), false);
-            btnIcon.Text = "Button" + device.DeviceEpoint;
+            btnIcon.Text = "BUTTON" + device.DeviceEpoint;
             btnIcon.TextAlignment = TextAlignment.Center;
             btnIcon.TextColor = UserCenterColor.Current.TextGrayColor1;
+            btnIcon.IsBold = true;
             if (frame is FrameLayoutStatuControl)
             {
-                ((FrameLayoutStatuControl)frame).AddChidren(btnIcon, ChidrenBindMode.BindEventOnly);
+                ((FrameLayoutStatuControl)frame).AddChidren(btnIcon, ChidrenBindMode.BindEvent);
                 ((FrameLayoutStatuControl)frame).ButtonClickEvent += (sender, e) =>
                 {
                     //鎸夐敭鐐瑰嚮
@@ -447,7 +449,7 @@
         {
             //鎸夐敭1
             var btnButton1 = this.InitDeviceButtonControl(frameBack, listDevice[0]);
-            btnButton1.TextSize = 12;
+            btnButton1.TextSize = 10;
             btnButton1.Height = this.GetPictrueRealSize(175);
             btnButton1.Width = this.GetPictrueRealSize(183);
             btnButton1.X = this.GetPictrueRealSize(34);
@@ -455,7 +457,7 @@
 
             //鎸夐敭2
             var btnButton2 = this.InitDeviceButtonControl(frameBack, listDevice[1]);
-            btnButton2.TextSize = 12;
+            btnButton2.TextSize = 10;
             btnButton2.Height = this.GetPictrueRealSize(175);
             btnButton2.Width = this.GetPictrueRealSize(183);
             btnButton2.X = btnButton1.Right;
@@ -463,7 +465,7 @@
 
             //鎸夐敭3
             var btnButton3 = this.InitDeviceButtonControl(frameBack, listDevice[2]);
-            btnButton3.TextSize = 12;
+            btnButton3.TextSize = 10;
             btnButton3.Height = this.GetPictrueRealSize(175);
             btnButton3.Width = this.GetPictrueRealSize(183);
             btnButton3.X = btnButton1.X;
@@ -471,7 +473,7 @@
 
             //鎸夐敭4
             var btnButton4 = this.InitDeviceButtonControl(frameBack, listDevice[3]);
-            btnButton4.TextSize = 12;
+            btnButton4.TextSize = 10;
             btnButton4.Height = this.GetPictrueRealSize(175);
             btnButton4.Width = this.GetPictrueRealSize(183);
             btnButton4.X = btnButton2.X;
@@ -541,7 +543,7 @@
             frameButton1.Width = this.GetPictrueRealSize(183);
             frameBack.AddChidren(frameButton1);
             var btnButton1 = this.InitDeviceButtonControl(frameButton1, device1);
-            btnButton1.TextSize = 10;
+            btnButton1.TextSize = 8;
             btnButton1.Height = this.GetPictrueRealSize(35);
             btnButton1.Width = this.GetPictrueRealSize(183);
             btnButton1.Y = this.GetPictrueRealSize(37);
@@ -554,7 +556,7 @@
             frameButton2.Y = frameButton1.Bottom;
             frameBack.AddChidren(frameButton2);
             var btnButton2 = this.InitDeviceButtonControl(frameButton2, device2);
-            btnButton2.TextSize = 10;
+            btnButton2.TextSize = 8;
             btnButton2.Height = btnButton1.Height;
             btnButton2.Width = btnButton1.Width;
             btnButton2.Y = this.GetPictrueRealSize(20);
@@ -588,7 +590,7 @@
             nowContr.TextColor = 0xfffb744a;
 
             nowSelectControl = nowContr;
-            nowSelectDevice = Common.LocalDevice.Current.GetDevice(deviceObj.DeviceAddr, Convert.ToInt32(nowContr.Text.Replace("Button", string.Empty)));
+            nowSelectDevice = HdlDeviceCommonLogic.Current.GetDevice(deviceObj.DeviceAddr, Convert.ToInt32(nowContr.Text.Replace("BUTTON", string.Empty)));
 
             //閲嶆柊鍒濆鍖栬彍鍗曡
             this.InitMenuRow();

--
Gitblit v1.8.0