| | |
| | | /// 加载功能列表 |
| | | /// </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_")) |
| | |
| | | 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_")) |
| | | { |