From 0414d9754bc61b5e496930ff184ede647ab4cc3a Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期五, 11 十二月 2020 14:35:10 +0800
Subject: [PATCH] 2020-12-11-1

---
 HDL_ON/Entity/FunctionList.cs |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/HDL_ON/Entity/FunctionList.cs b/HDL_ON/Entity/FunctionList.cs
index 5f27046..aba9d57 100644
--- a/HDL_ON/Entity/FunctionList.cs
+++ b/HDL_ON/Entity/FunctionList.cs
@@ -193,7 +193,7 @@
         /// </summary>
         public List<Function> GetAllDeviceFunctionList()
         {
-            //if (deviceFunctionList == null)
+            if (deviceFunctionList == null || deviceFunctionList.Count == 0)
             {
                 deviceFunctionList = new List<Function>();
                 deviceFunctionList.AddRange(aCs);
@@ -370,8 +370,9 @@
                         //    }
                         //})
                         //{ IsBackground = true }.Start();
-                        foreach (var localFunction in List.GetAllDeviceFunctionList())
+                        for (int i =0;i < List.GetAllDeviceFunctionList().Count;)
                         {
+                            var localFunction = List.GetAllDeviceFunctionList()[i];
                             var newFunction = deviceList.list.Find((obj) => obj.deviceId == localFunction.deviceId);
                             if (newFunction == null)//濡傛灉浜戠鏈�鏂版暟鎹病鏈夎鏉℃暟鎹紝鍒欐湰鍦伴渶瑕佸垹鎺夎鏁版嵁璁板綍
                             {
@@ -379,6 +380,7 @@
                             }
                             else
                             {
+                                i++;
                                 if (localFunction.modifyTime != newFunction.modifyTime)
                                 {
                                     localFunction.name = newFunction.name;
@@ -431,8 +433,9 @@
                         //    }
                         //})
                         //{ IsBackground = true }.Start();
-                        foreach (var localScene in List.scenes)
+                        for(int i=0;i<List.scenes.Count;)
                         {
+                            var localScene = List.scenes[i];
                             var newScene = sceneList.Find((obj) => obj.userSceneId == localScene.userSceneId);
                             if (newScene == null)//濡傛灉浜戠鏈�鏂版暟鎹病鏈夎鏉℃暟鎹紝鍒欐湰鍦伴渶瑕佸垹鎺夎鏁版嵁璁板綍
                             {
@@ -440,6 +443,7 @@
                             }
                             else
                             {
+                                i++;
                                 if (localScene.modifyTime != newScene.modifyTime)
                                 {
                                     localScene.name = newScene.name;

--
Gitblit v1.8.0