From 2d5639dfb8014e78e6f1e68240fa751c19bb3a28 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期四, 02 一月 2020 18:35:40 +0800
Subject: [PATCH] 2019.1.2

---
 ZigbeeApp/Shared/Phone/Device/Category/CategoryAddScene.cs |   35 +++++++++++++++++++++--------------
 1 files changed, 21 insertions(+), 14 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Category/CategoryAddScene.cs b/ZigbeeApp/Shared/Phone/Device/Category/CategoryAddScene.cs
index 4b8facc..be89045 100644
--- a/ZigbeeApp/Shared/Phone/Device/Category/CategoryAddScene.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Category/CategoryAddScene.cs
@@ -4,6 +4,7 @@
 using Shared.Common;
 using Shared.Phone.Device.CommonForm;
 using Shared.Phone.Device.Room;
+using Shared.Phone.UserCenter;
 using static ZigBee.Device.Scene;
 
 namespace Shared.Phone.Device.Category
@@ -90,9 +91,11 @@
         /// <summary>
         /// selectedTimeAction
         /// </summary>
-        public Action<SceneTargetDeviceUI> selectedAction;
-
-
+        private Action<SceneTargetDeviceUI> selectedAction;
+        /// <summary>
+        /// 淇敼鍦烘櫙action
+        /// </summary>
+        public Action<SceneUI, Common.Room> EditorAction; 
 
         #endregion
 
@@ -108,7 +111,6 @@
         /// </summary>
         public override void RemoveFromParent()
         {
-            Category.instance?.RefreshBodyView();
             base.RemoveFromParent();
         }
         /// <summary>
@@ -254,8 +256,8 @@
                         }
                     }
                 }
-
-                if (sceneTargetDevicesList.Count > 2)
+                
+                if (sceneTargetDevicesList.Count > 1)
                 {
                     var targetRowLayout = new RowLayout()
                     {
@@ -438,6 +440,7 @@
             targetFL.AddChidren(TargetListScrolView);
 
             confirmBtn = new CommonForm.CompleteButton(1656, 907, 127);
+            confirmBtn.TextID = R.MyInternationalizationString.Next;
             AddChidren(confirmBtn);
 
             if (isModify)
@@ -576,7 +579,7 @@
                 {
                     selectFL.RemoveFromParent();
                     var tradeTime = DateTime.Now.ToString("yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo);
-                    var fileName = $"SceneIcon_{tradeTime}";
+                    var fileName = $"SceneIcon_{tradeTime}.png";
                     //閫氳繃鐩告満鎷嶇収瑁佸壀
                     CropImage.TakePicture((imagePath) =>
                     {
@@ -585,6 +588,7 @@
                             if (IconPathType != 0)
                             {
                                 Global.DeleteFilebyHomeId(backGround.ImagePath);
+                                HdlAutoBackupLogic.DeleteFile(backGround.ImagePath);
                             }
                         }
 
@@ -600,7 +604,7 @@
                 {
                     selectFL.RemoveFromParent();
                     var tradeTime = DateTime.Now.ToString("yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo);
-                    var fileName = $"SceneIcon_{tradeTime}";
+                    var fileName = $"SceneIcon_{tradeTime}.png";
                     //浠庣浉鍐岄�夋嫨鍥剧墖瑁佸壀
                     CropImage.SelectPicture((imagePath) =>
                     {
@@ -609,6 +613,7 @@
                             if (IconPathType != 0)
                             {
                                 Global.DeleteFilebyHomeId(backGround.ImagePath);
+                                HdlAutoBackupLogic.DeleteFile(backGround.ImagePath);
                             }
                         }
 
@@ -870,7 +875,7 @@
                         try
                         {
                             var tradeTime = DateTime.Now.ToString("yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo);
-                            var fileName = $"SceneIcon_{tradeTime}";
+                            var fileName = $"SceneIcon_{tradeTime}.png";
                             if (modifySceneUI.Name != nameRow.NameText.Text.Trim())
                             {
                                 if (Common.Room.CurrentRoom.GetSameFloorScenes(curRoom.FloorId).Find(s => s.Name == nameRow.NameText.Text.Trim()) != null)
@@ -897,10 +902,13 @@
                             if (OldIconPathType != 0)
                             {
                                 Shared.IO.FileUtils.DeleteFile(System.IO.Path.Combine(Config.Instance.FullPath, OldBackgroundImagePath));
+                                HdlAutoBackupLogic.DeleteFile(System.IO.Path.Combine(Config.Instance.FullPath, OldBackgroundImagePath));
+
                             }
                             if (IconPathType == 1 || IconPathType == 2)
                             {
                                 Shared.IO.FileUtils.WriteFileByBytes(System.IO.Path.Combine(Config.Instance.FullPath, fileName), backGround.ImageBytes);
+                                HdlAutoBackupLogic.AddOrEditorFile(System.IO.Path.Combine(Config.Instance.FullPath, fileName));
                                 modifySceneUI.IconPath = fileName;
                             }
                             else
@@ -1138,7 +1146,6 @@
                         {
                             CommonPage.Loading.Hide();
                         }
-
                     }
                 }
 
@@ -1240,7 +1247,7 @@
 
             var deviceName = new Button
             {
-                Width = Application.GetRealWidth(400),
+                Width = Application.GetRealWidth(600),
                 Gravity = Gravity.CenterHorizontal,
                 TextColor = ZigbeeColor.Current.GXCTextBlackColor,
                 TextSize = 16,
@@ -1396,7 +1403,7 @@
 
             var deviceName = new Button
             {
-                Width = Application.GetRealWidth(400),
+                Width = Application.GetRealWidth(600),
                 Gravity = Gravity.CenterHorizontal,
                 TextColor = ZigbeeColor.Current.GXCTextBlackColor,
                 TextSize = 16,
@@ -1561,7 +1568,7 @@
 
             var deviceName = new Button
             {
-                Width = Application.GetRealWidth(400),
+                Width = Application.GetRealWidth(600),
                 Gravity = Gravity.CenterHorizontal,
                 TextColor = ZigbeeColor.Current.GXCTextBlackColor,
                 TextSize = 16,
@@ -1734,7 +1741,7 @@
 
             var deviceName = new Button
             {
-                Width = Application.GetRealWidth(400),
+                Width = Application.GetRealWidth(600),
                 Gravity = Gravity.CenterHorizontal,
                 TextColor = ZigbeeColor.Current.GXCTextBlackColor,
                 TextSize = 16,

--
Gitblit v1.8.0