From 15c5215e0a16207baace58b81f406acfd84b4de5 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期五, 28 八月 2020 16:00:26 +0800
Subject: [PATCH] V2.508281-beta 2020-08-28 1.搜索设备时,如果红外空调备注为空时,默认”AC“+回路号命名。 2.添加场景时,卷帘和开合帘提交改为百分比进度参数。 3.增加房间页面,长按设备名字,弹出修改备注。

---
 Crabtree/SmartHome/UI/SimpleControl/Phone/Room/UserRoom.cs |   44 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 44 insertions(+), 0 deletions(-)

diff --git a/Crabtree/SmartHome/UI/SimpleControl/Phone/Room/UserRoom.cs b/Crabtree/SmartHome/UI/SimpleControl/Phone/Room/UserRoom.cs
index 1fa0179..6dd2f3a 100644
--- a/Crabtree/SmartHome/UI/SimpleControl/Phone/Room/UserRoom.cs
+++ b/Crabtree/SmartHome/UI/SimpleControl/Phone/Room/UserRoom.cs
@@ -918,6 +918,9 @@
                         SelectedTextColor = SkinStyle.Current.TextColor1,
                     };
                     acRowView.AddChidren (tempDeviceName);
+                    //2020-08-28 澧炲姞闀挎寜淇敼璁惧澶囨敞
+                    ButtonNameAddMouseLongEventHandler (tempDeviceName, devcieCommon);
+
                     tempDeviceName.MouseUpEventHandler += openACControlPageEvent;
 
                     Button btnMode = new Button () {
@@ -1031,6 +1034,10 @@
                         IsMoreLines = true
                     };
                     fhRowView.AddChidren (tempDeviceName);
+
+                    //2020-08-28 澧炲姞闀挎寜淇敼璁惧澶囨敞
+                    ButtonNameAddMouseLongEventHandler (tempDeviceName, devcieCommon);
+
                     tempDeviceName.MouseUpEventHandler += (sender2, e2) => {
                         UserFHPage fhView = new UserFHPage (fh, room);
                         if (roomFilePath == Room.FavoriteRoom) {
@@ -1148,6 +1155,13 @@
                             IsMoreLines = true
                         };
                         DeviceRowView.AddChidren (btnName);
+
+                        //2020-08-28 澧炲姞闀挎寜淇敼璁惧澶囨敞
+                        ButtonNameAddMouseLongEventHandler (btnName, devcieCommon);
+                        
+                        //btnName.MouseLongEventHandler += (sender, e)=>{
+                        //    RemarkDeviceName (devcieCommon, SimpleControl.CommonPage.MyEncodingUTF8.GetBytes (Newtonsoft.Json.JsonConvert.SerializeObject (devcieCommon)), btnName);
+                        //};
 
                         Button tempSwitch = new Button () {
                             Width = Application.GetMinRealAverage (90),
@@ -2364,5 +2378,35 @@
                 });
             });
         }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="btnName"></param>
+        /// <param name="devcieCommon"></param>
+        void ButtonNameAddMouseLongEventHandler (Button btnName,Common devcieCommon)
+        {
+            //2020-08-28 澧炲姞闀挎寜淇敼璁惧澶囨敞
+            btnName.MouseLongEventHandler += (sender, e) => {
+                RemarkDeviceName (devcieCommon, SimpleControl.CommonPage.MyEncodingUTF8.GetBytes (Newtonsoft.Json.JsonConvert.SerializeObject (devcieCommon)), btnName);
+            };
+        }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="commonDevice"></param>
+        /// <param name="commonBytes"></param>
+        /// <param name="btnEquipment"></param>
+        void RemarkDeviceName (Common commonDevice, byte[] commonBytes, Button btnEquipment)
+        {
+            Action successAction = () => {
+                GenericDialog.Current.RefreshRemark (commonDevice);
+                //if (!roomDeviceFilePathList.Contains (filePath)) {
+                //    roomDeviceFilePathList.Add (filePath);
+                //}
+            };
+            GenericDialog.Current.ShowModifyRemarksDialog (commonDevice, commonBytes, btnEquipment, successAction);
+        }
     }
 }
\ No newline at end of file

--
Gitblit v1.8.0