From b4d92451b2071c9762b519275601424e276db90d Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期二, 16 三月 2021 13:59:49 +0800 Subject: [PATCH] Merge branch 'dev-tzy' into temp-wxr --- HDL_ON/Entity/FunctionList.cs | 23 +++++++++++++++++++---- 1 files changed, 19 insertions(+), 4 deletions(-) diff --git a/HDL_ON/Entity/FunctionList.cs b/HDL_ON/Entity/FunctionList.cs index 7239051..0d05bdb 100644 --- a/HDL_ON/Entity/FunctionList.cs +++ b/HDL_ON/Entity/FunctionList.cs @@ -201,7 +201,11 @@ /// 鍔犺浇鍔熻兘鍒楄〃 /// </summary> /// <param name="filePath"></param> - public void IniFunctionList(string filePath) + /// <param name="checkRepeat"> + /// <para>鑰冭檻鍒版�ц兘闂杩藉姞姝ゅ彉閲�,鏄惁妫�娴嬮噸澶�,鍙function鏈夋晥</para> + /// <para>true:褰撻噸澶嶅瓨鍦ㄦ椂,鏇挎崲鎺�</para> + /// <para>false:鐩存帴鏃犳潯浠舵坊鍔�</para></param> + public void IniFunctionList(string filePath, bool checkRepeat = false) { // todo 澧炲姞璁惧锛屽鍔犲姛鑳借繘鍔熻兘鍒楄〃 if (filePath.StartsWith("FunctionData_")) @@ -214,10 +218,21 @@ FileUtlis.Files.DeleteFile(filePath); return; } - - + if (checkRepeat == true) + { + //妫�娴嬮噸澶� + for (int i = 0; i < Functions.Count; i++) + { + if (Functions[i].deviceId == tempFunction.deviceId) + { + //鍏堢Щ闄ゆ帀鍐嶅姞 + Functions.RemoveAt(i); + Functions.Add(tempFunction); + return; + } + } + } Functions.Add(tempFunction); - } if (filePath.StartsWith("SceneData_")) { -- Gitblit v1.8.0