From 35c4bc03ee8da50317cd3f33e9f52f0a4259affd Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期三, 23 十二月 2020 15:53:08 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/WJC' into NewFilePath

---
 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs
index 8a0f17e..3e7d9f5 100755
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs
@@ -5,7 +5,7 @@
 namespace HDL_ON.UI.UI2.Intelligence.Automation
 {
 
-    public  class  LogicMethod
+    public class LogicMethod
     {
         /// <summary>
         /// 琛ㄧず鏄潯浠�
@@ -141,8 +141,9 @@
             room1.uid = "鍏ㄩ儴鍖哄煙";//榛樿sid鐢ㄨ瘑鍒鎴块棿
             roomList.Add(room1);//榛樿娣诲姞鍒版埧闂村垪琛ㄩ噷
             var roomLists = GetGatewayRoomList();
-            foreach (var room in roomLists)
+            for (int i = 0; i < roomLists.Count; i++)
             {
+                var room = roomLists[i];
                 var devlist = GetRoomDevice(room);
                 if (devlist.Count == 0)
                 {
@@ -202,8 +203,9 @@
         {
             HDL_ON.Entity.Function device = new Entity.Function() { name = "Unknown" };
             List<HDL_ON.Entity.Function> deviceLists = GetGatewayDeviceList();
-            foreach (var dev in deviceLists)
+            for (int i = 0; i < deviceLists.Count; i++)
             {
+                var dev = deviceLists[i];
                 if (dev.sid == sid)
                 {
                     device = dev;
@@ -222,8 +224,9 @@
         {
             HDL_ON.Entity.Scene scene = new Entity.Scene() { name = "Unknown" };
             List<HDL_ON.Entity.Scene> sceneLists = GetSceneList();
-            foreach (var sce in sceneLists)
+            for (int i = 0; i < sceneLists.Count; i++)
             {
+                var sce = sceneLists[i];
                 if (sce.sid == sid)
                 {
                     scene = sce;
@@ -242,8 +245,10 @@
             string roomName = "";
             List<HDL_ON.Entity.Room> roomLists = GetGatewayRoomList();
 
-            foreach (var dev in device.roomIds)
+
+            for (int i = 0; i < device.roomIds.Count; i++)
             {
+                var dev = device.roomIds[i];
                 var room = roomLists.Find((c) => c.uid == dev);
                 if (room != null)
                 {
@@ -409,14 +414,17 @@
         public static List<Entity.Function> GetShowDeviceList(List<FunctionType> functionType, List<HDL_ON.Entity.Function> deviceList)
         {
             List<HDL_ON.Entity.Function> devList = new List<Entity.Function>();
-            foreach (var dev in deviceList)
+            for (int i = 0; i < deviceList.Count; i++)
             {
+                var dev = deviceList[i];
                 if (functionType.Contains(dev.functionType))
                 {
                     ///杩囨护鎺変笉闇�瑕佹樉绀虹殑璁惧
                     devList.Add(dev);
                 }
+
             }
+
             return devList;
         }
         /// <summary>

--
Gitblit v1.8.0