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/Panel/PanelButtonSettionForm.cs |  156 +++++++++++++++++++++++++++++-----------------------
 1 files changed, 87 insertions(+), 69 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelButtonSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelButtonSettionForm.cs
index 390b7e9..f0a684e 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelButtonSettionForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelButtonSettionForm.cs
@@ -39,7 +39,7 @@
         /// <summary>
         /// 绠�绾﹂潰鏉跨殑闇囧姩鏁版嵁
         /// </summary>
-        private HdlDevicePanelLogic.VibrationInfo vibrationInfo = null;
+        private HdlDevicePanelLogic.PanelVibrationInfo vibrationInfo = null;
         /// <summary>
         /// 鏄惁宸茬粡璇诲彇浜嗛渿鍔ㄦ暟鎹�
         /// </summary>
@@ -94,7 +94,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();
@@ -113,7 +113,7 @@
                     if (oldName != newName)
                     {
                         //璁惧鍚嶇О淇敼
-                        var result = await Common.LocalDevice.Current.ReName(device, newName);
+                        var result = Common.LocalDevice.Current.ReName(device, newName);
                         if (result == false)
                         {
                             //鍏抽棴
@@ -126,6 +126,11 @@
                 //鍏抽棴鑷韩
                 this.CloseForm();
             };
+            //濡傛灉褰撳墠鏄睍绀烘ā鏉�,鍒欎笉鑳界紪杈�
+            if (Common.Config.Instance.Home.IsShowTemplate == true)
+            {
+                btnFinish.CanClick = false;
+            }
         }
 
         /// <summary>
@@ -144,30 +149,35 @@
             //鎸夐敭澶囨敞
             string caption = Language.StringByID(R.MyInternationalizationString.uPanelButtonNote);
             this.btnDeviceName = new FrameCaptionInputControl(caption, nameValue, listview.rowSpace / 2);
+            btnDeviceName.txtInput.MaxByte = 48;//闄愬埗鍙兘杈撳叆48涓瓧鑺�
             listview.AddChidren(btnDeviceName);
             btnDeviceName.InitControl();
             btnDeviceName.AddBottomLine();
-            btnDeviceName.txtInput.FinishInputEvent += async () =>
+            //濡傛灉褰撳墠鏄睍绀烘ā鏉�,鍒欎笉鑳界紪杈�
+            if (Common.Config.Instance.Home.IsShowTemplate == false)
             {
-                string oldName = Common.LocalDevice.Current.GetDeviceEpointName(nowSelectDevice);
-                if (btnDeviceName.Text.Trim() == string.Empty)
+                btnDeviceName.txtInput.FinishInputEvent += () =>
                 {
-                    //灏嗗悕瀛楄繕鍘�
-                    btnDeviceName.Text = oldName;
-                }
-                if (oldName != btnDeviceName.Text.Trim())
-                {
-                    //璁惧鍚嶇О淇敼
-                    var result = await Common.LocalDevice.Current.ReName(nowSelectDevice, btnDeviceName.Text.Trim());
-                    if (result == false)
+                    string oldName = Common.LocalDevice.Current.GetDeviceEpointName(nowSelectDevice);
+                    if (btnDeviceName.Text.Trim() == string.Empty)
                     {
-                        return;
+                        //灏嗗悕瀛楄繕鍘�
+                        btnDeviceName.Text = oldName;
                     }
-                    //鎸夐敭澶囨敞淇敼鎴愬姛!
-                    string msg = Language.StringByID(R.MyInternationalizationString.uPanelButtonReNoteSuccess);
-                    this.ShowMassage(ShowMsgType.Tip, msg);
-                }
-            };
+                    if (oldName != btnDeviceName.Text.Trim())
+                    {
+                        //璁惧鍚嶇О淇敼
+                        var result = Common.LocalDevice.Current.ReName(nowSelectDevice, btnDeviceName.Text.Trim());
+                        if (result == false)
+                        {
+                            return;
+                        }
+                        //鎸夐敭澶囨敞淇敼鎴愬姛!
+                        string msg = Language.StringByID(R.MyInternationalizationString.uPanelButtonReNoteSuccess);
+                        this.ShowMassage(ShowMsgType.Tip, msg);
+                    }
+                };
+            }
 
             //鎵�灞炲尯鍩�
             var rowBeloneArea = new BelongAreaControl(listview.rowSpace / 2);
@@ -202,7 +212,8 @@
         private void InitTopRightMenu()
         {
             //妫�娴嬫鍥炶矾鏄惁鎷ユ湁瀹氫綅鍔熻兘
-            if (Common.LocalDevice.Current.DeviceIsCanFixedPosition(nowSelectDevice) == false)
+            if (Common.LocalDevice.Current.DeviceIsCanFixedPosition(nowSelectDevice) == false
+                || Common.Config.Instance.Home.IsShowTemplate == true)
             {
                 return;
             }
@@ -322,7 +333,9 @@
             //鍙湁绠�绾﹂潰鏉挎墠浼氭湁杩欎釜鑿滃崟
             if (myType.ConcreteType == Common.DeviceConcreteType.ButtonPanel_SimpleTwo
                 || myType.ConcreteType == Common.DeviceConcreteType.ButtonPanel_SimpleThree
-                || myType.ConcreteType == Common.DeviceConcreteType.ButtonPanel_SimpleFour)
+                || myType.ConcreteType == Common.DeviceConcreteType.ButtonPanel_SimpleFour
+                || myType.ConcreteType == Common.DeviceConcreteType.ButtonPanel_FourButtonScene
+                || myType.ConcreteType == Common.DeviceConcreteType.ButtonPanel_TwoButtonCurtain)
             {
                 //闇囧姩鍙嶉
                 var rowContr = new FrameRowControl(listview.rowSpace / 2);
@@ -371,6 +384,11 @@
                         btnSwitch.CanClick = true;
                     });
                 };
+                //濡傛灉褰撳墠鏄睍绀烘ā鏉�,鍒欎笉鑳界紪杈�
+                if (Common.Config.Instance.Home.IsShowTemplate == true)
+                {
+                    btnSwitch.CanClick = false;
+                }
                 if (hadReadVibrationInfo == true)
                 {
                     //涓嶅啀璇诲彇
@@ -436,8 +454,8 @@
             var frameBorder = new FrameLayout();
             frameBorder.Y = Application.GetRealHeight(150);
             frameBorder.Gravity = Gravity.CenterHorizontal;
-            frameBorder.Width = Application.GetMinRealAverage(426);
-            frameBorder.Height = Application.GetMinRealAverage(426);
+            frameBorder.Width = this.GetPictrueRealSize(426);
+            frameBorder.Height = this.GetPictrueRealSize(426);
             listBackControl.frameTable.AddChidren(frameBorder);
 
             var btnPic = new PicViewControl(frameBorder.Width, frameBorder.Height, false);
@@ -468,18 +486,18 @@
         /// <param name="device">璁惧瀵硅薄</param>
         /// <param name="isFirst">鏄惁鏄涓�涓�</param>
         /// <returns></returns>
-        private void InitDeviceIcon(FrameLayoutControl frame, CommonDevice device)
+        private void InitDeviceIcon(FrameLayoutStatuControl frame, CommonDevice device)
         {
             //涓嶄娇鐢ㄧ偣鍑荤壒鏁�
             frame.UseClickStatu = false;
 
-            var btnIcon = new NormalViewControl(Application.GetMinRealAverage(52), Application.GetMinRealAverage(52), false);
+            var btnIcon = new NormalViewControl(this.GetPictrueRealSize(52), this.GetPictrueRealSize(52), false);
             btnIcon.Name = "btn" + device.DeviceEpoint;
             btnIcon.Gravity = Gravity.Center;
             btnIcon.RadiusEx = 16;
             btnIcon.BorderWidth = 2;
             btnIcon.BorderColor = 0xff979797;
-            frame.AddChidren(btnIcon, ChidrenBindMode.BindEventOnly);
+            frame.AddChidren(btnIcon, ChidrenBindMode.BindEvent);
             //鐐瑰嚮浜嬩欢
             frame.ButtonClickEvent += (sender, e) =>
             {
@@ -506,20 +524,20 @@
         private void InitTwoButtonPanelIcon(FrameLayout frameBack, List<CommonDevice> listDevice)
         {
             //鎸夐敭1
-            var frame1 = new FrameLayoutControl();
-            frame1.Height = Application.GetMinRealAverage(110);
-            frame1.Width = Application.GetMinRealAverage(110);
-            frame1.Y = Application.GetMinRealAverage(63);
+            var frame1 = new FrameLayoutStatuControl();
+            frame1.Height = this.GetPictrueRealSize(110);
+            frame1.Width = this.GetPictrueRealSize(110);
+            frame1.Y = this.GetPictrueRealSize(63);
             frame1.Gravity = Gravity.CenterHorizontal;
             frameBack.AddChidren(frame1);
             //鍒濆鍖栬澶囧浘鏍�
             this.InitDeviceIcon(frame1, listDevice[0]);
 
             //鎸夐敭2
-            var frame2 = new FrameLayoutControl();
-            frame2.Height = Application.GetMinRealAverage(110);
-            frame2.Width = Application.GetMinRealAverage(110);
-            frame2.Y = Application.GetMinRealAverage(245);
+            var frame2 = new FrameLayoutStatuControl();
+            frame2.Height = this.GetPictrueRealSize(110);
+            frame2.Width = this.GetPictrueRealSize(110);
+            frame2.Y = this.GetPictrueRealSize(245);
             frame2.Gravity = Gravity.CenterHorizontal;
             frameBack.AddChidren(frame2);
             //鍒濆鍖栬澶囧浘鏍�
@@ -538,31 +556,31 @@
         private void InitThreeButtonPanelIcon(FrameLayout frameBack, List<CommonDevice> listDevice)
         {
             //鎸夐敭1
-            var frame1 = new FrameLayoutControl();
-            frame1.Height = Application.GetMinRealAverage(110);
-            frame1.Width = Application.GetMinRealAverage(110);
-            frame1.Y = Application.GetMinRealAverage(63);
+            var frame1 = new FrameLayoutStatuControl();
+            frame1.Height = this.GetPictrueRealSize(110);
+            frame1.Width = this.GetPictrueRealSize(110);
+            frame1.Y = this.GetPictrueRealSize(63);
             frame1.Gravity = Gravity.CenterHorizontal;
             frameBack.AddChidren(frame1);
             //鍒濆鍖栬澶囧浘鏍�
             this.InitDeviceIcon(frame1, listDevice[0]);
 
             //鎸夐敭2
-            var frame2 = new FrameLayoutControl();
-            frame2.Height = Application.GetMinRealAverage(110);
-            frame2.Width = Application.GetMinRealAverage(110);
-            frame2.X = Application.GetMinRealAverage(63);
-            frame2.Y = Application.GetMinRealAverage(245);
+            var frame2 = new FrameLayoutStatuControl();
+            frame2.Height = this.GetPictrueRealSize(110);
+            frame2.Width = this.GetPictrueRealSize(110);
+            frame2.X = this.GetPictrueRealSize(63);
+            frame2.Y = this.GetPictrueRealSize(245);
             frameBack.AddChidren(frame2);
             //鍒濆鍖栬澶囧浘鏍�
             this.InitDeviceIcon(frame2, listDevice[1]);
 
             //鎸夐敭3
-            var frame3 = new FrameLayoutControl();
-            frame3.Height = Application.GetMinRealAverage(110);
-            frame3.Width = Application.GetMinRealAverage(110);
-            frame3.X = Application.GetMinRealAverage(245);
-            frame3.Y = Application.GetMinRealAverage(245);
+            var frame3 = new FrameLayoutStatuControl();
+            frame3.Height = this.GetPictrueRealSize(110);
+            frame3.Width = this.GetPictrueRealSize(110);
+            frame3.X = this.GetPictrueRealSize(245);
+            frame3.Y = this.GetPictrueRealSize(245);
             frameBack.AddChidren(frame3);
             //鍒濆鍖栬澶囧浘鏍�
             this.InitDeviceIcon(frame3, listDevice[2]);
@@ -580,41 +598,41 @@
         private void InitFourButtonPanelIcon(FrameLayout frameBack, List<CommonDevice> listDevice)
         {
             //鎸夐敭1
-            var frame1 = new FrameLayoutControl();
-            frame1.Height = Application.GetMinRealAverage(110);
-            frame1.Width = Application.GetMinRealAverage(110);
-            frame1.X = Application.GetMinRealAverage(63);
-            frame1.Y = Application.GetMinRealAverage(63);
+            var frame1 = new FrameLayoutStatuControl();
+            frame1.Height = this.GetPictrueRealSize(110);
+            frame1.Width = this.GetPictrueRealSize(110);
+            frame1.X = this.GetPictrueRealSize(63);
+            frame1.Y = this.GetPictrueRealSize(63);
             frameBack.AddChidren(frame1);
             //鍒濆鍖栬澶囧浘鏍�
             this.InitDeviceIcon(frame1, listDevice[0]);
 
             //鎸夐敭2
-            var frame2 = new FrameLayoutControl();
-            frame2.Height = Application.GetMinRealAverage(110);
-            frame2.Width = Application.GetMinRealAverage(110);
-            frame2.X = Application.GetMinRealAverage(245);
-            frame2.Y = Application.GetMinRealAverage(63);
+            var frame2 = new FrameLayoutStatuControl();
+            frame2.Height = this.GetPictrueRealSize(110);
+            frame2.Width = this.GetPictrueRealSize(110);
+            frame2.X = this.GetPictrueRealSize(245);
+            frame2.Y = this.GetPictrueRealSize(63);
             frameBack.AddChidren(frame2);
             //鍒濆鍖栬澶囧浘鏍�
             this.InitDeviceIcon(frame2, listDevice[1]);
 
             //鎸夐敭3
-            var frame3 = new FrameLayoutControl();
-            frame3.Height = Application.GetMinRealAverage(110);
-            frame3.Width = Application.GetMinRealAverage(110);
-            frame3.X = Application.GetMinRealAverage(63);
-            frame3.Y = Application.GetMinRealAverage(245);
+            var frame3 = new FrameLayoutStatuControl();
+            frame3.Height = this.GetPictrueRealSize(110);
+            frame3.Width = this.GetPictrueRealSize(110);
+            frame3.X = this.GetPictrueRealSize(63);
+            frame3.Y = this.GetPictrueRealSize(245);
             frameBack.AddChidren(frame3);
             //鍒濆鍖栬澶囧浘鏍�
             this.InitDeviceIcon(frame3, listDevice[2]);
 
             //鎸夐敭4
-            var frame4 = new FrameLayoutControl();
-            frame4.Height = Application.GetMinRealAverage(110);
-            frame4.Width = Application.GetMinRealAverage(110);
-            frame4.X = Application.GetMinRealAverage(245);
-            frame4.Y = Application.GetMinRealAverage(245);
+            var frame4 = new FrameLayoutStatuControl();
+            frame4.Height = this.GetPictrueRealSize(110);
+            frame4.Width = this.GetPictrueRealSize(110);
+            frame4.X = this.GetPictrueRealSize(245);
+            frame4.Y = this.GetPictrueRealSize(245);
             frameBack.AddChidren(frame4);
             //鍒濆鍖栬澶囧浘鏍�
             this.InitDeviceIcon(frame4, listDevice[3]);

--
Gitblit v1.8.0