From 2f05a4874e64b3c2e60055e1246025f8a0367f78 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期一, 15 三月 2021 17:53:09 +0800 Subject: [PATCH] 红外宝最终版本 --- 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 af63fec..baaa0f8 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