From ecba45c93391066bc30c7bd602c3a7683fbb99a7 Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期五, 31 七月 2020 10:56:12 +0800
Subject: [PATCH] 临时备份

---
 ZigbeeApp/Shared/Phone/Category/AddOrEditorSceneForm.cs |   29 +++++++++++++++++++----------
 1 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Category/AddOrEditorSceneForm.cs b/ZigbeeApp/Shared/Phone/Category/AddOrEditorSceneForm.cs
index 4ff409d..ca045b2 100755
--- a/ZigbeeApp/Shared/Phone/Category/AddOrEditorSceneForm.cs
+++ b/ZigbeeApp/Shared/Phone/Category/AddOrEditorSceneForm.cs
@@ -291,10 +291,10 @@
                 this.ShowAddTargetMenu();
             };
 
-            HdlThreadLogic.Current.RunThread(async () =>
+            HdlThreadLogic.Current.RunThread(() =>
             {
                 //浠庣綉鍏宠幏鍙栧満鏅殑鎵ц鐩爣
-                var result = await this.GetSceneTargetList();
+                var result = this.GetSceneTargetList();
                 if (result == true)
                 {
                     //娣诲姞銆愭墽琛岀洰鏍囪銆�
@@ -633,7 +633,7 @@
         /// 浠庣綉鍏宠幏鍙栧満鏅殑鎵ц鐩爣
         /// </summary>
         /// <returns></returns>
-        private async System.Threading.Tasks.Task<bool> GetSceneTargetList()
+        private bool GetSceneTargetList()
         {
             if (this.editorScene == null || this.listAdjustTarget != null)
             {
@@ -643,7 +643,7 @@
             //鎵撳紑杩涘害鏉�
             this.ShowProgressBar();
             //鑾峰彇鎵ц鐩爣鍒楄〃
-            var listData = await HdlSceneLogic.Current.GetAdjustTargetList(this.editorScene);
+            var listData = HdlSceneLogic.Current.GetAdjustTargetList(this.editorScene);
             if (listData == null)
             {
                 this.CloseProgressBar(ShowReLoadMode.YES);
@@ -676,7 +676,7 @@
             //閭d釜鐗规畩鐨勬帶浠�
             this.frameBottomTemp = new FrameLayout();
             frameBottomTemp.Height = bodyFrameLayout.Height - btnTemp.Yaxis + Application.GetRealHeight(23);
-            this.listBodyControl.AddChidrenFrame(frameBottomTemp);
+            this.listBodyControl.AddChidren(frameBottomTemp);
         }
 
         #endregion
@@ -789,10 +789,10 @@
         /// <summary>
         /// 淇濆瓨鏂板缓鐨勫満鏅�
         /// </summary>
-        private async void SaveSceneDataByNewMode()
+        private void SaveSceneDataByNewMode()
         {
             //娣诲姞鍦烘櫙
-            this.editorScene = await HdlSceneLogic.Current.AddNewSceneToGateway(this.cloneScene.Name, this.listAdjustTarget);
+            this.editorScene = HdlSceneLogic.Current.AddNewSceneToGateway(this.cloneScene.Name, this.listAdjustTarget);
             //鍏抽棴杩涘害鏉�
             this.CloseProgressBar();
 
@@ -823,7 +823,7 @@
             this.editorScene.Save();
 
             //鏂板缓鍦烘櫙,涓婚〉闇�瑕侀噸鏂板埛鏂�
-            UserView.UserPage.Instance.RefreshForm = true;
+            UserView.UserPage.Instance.RefreshAllForm = true;
 
             HdlThreadLogic.Current.RunMain(() =>
             {
@@ -864,6 +864,15 @@
                 //鍙樻洿鎴块棿
                 HdlSceneLogic.Current.ChangedSceneRoom(this.editorScene, this.nowRoomId);
             }
+            else
+            {
+                //绉婚櫎鍑烘埧闂�
+                var room = HdlRoomLogic.Current.GetRoomBySceneId(this.editorScene.Id);
+                if (room != null)
+                {
+                    HdlSceneLogic.Current.DeleteSceneFromRoom(room, this.editorScene);
+                }
+            }
 
             //鍥剧墖鏀瑰彉浜�
             if (isScenePictrueChanged == true)
@@ -871,7 +880,7 @@
                 if (this.editorScene.IconPathType != 0)
                 {
                     //鍒犻櫎鑷畾涔夊浘鐗�
-                    Shared.IO.FileUtils.DeleteFile(System.IO.Path.Combine(Config.Instance.FullPath, this.editorScene.IconPath));
+                    HdlFileLogic.Current.DeleteFile(System.IO.Path.Combine(Config.Instance.FullPath, this.editorScene.IconPath));
                     HdlAutoBackupLogic.DeleteFile(this.editorScene.IconPath);
                 }
                 if (this.cloneScene.IconPathType != 0)
@@ -893,7 +902,7 @@
             this.editorScene.Save();
 
             //缂栬緫鍦烘櫙,涓婚〉闇�瑕侀噸鏂板埛鏂�
-            UserView.UserPage.Instance.RefreshForm = true;
+            UserView.UserPage.Instance.RefreshAllForm = true;
 
             HdlThreadLogic.Current.RunMain(() =>
             {

--
Gitblit v1.8.0