105067 优化重复生成线材列表导致崩溃

This commit is contained in:
SINVO\yangshunli 2025-02-08 09:46:17 +08:00
parent ab5345b1b8
commit f0d4e614de
1 changed files with 21 additions and 13 deletions

View File

@ -727,7 +727,15 @@ public class LectotypeViewModel(string docId) : INotifyPropertyChanged
}
public void AddNotSavedLectotype(Dictionary<string, string> value)
{
value.ForEach(it => NotSavedLectotypeList.Add(it.Key, it.Value));
value.ForEach(it =>
{
if (NotSavedLectotypeList.Keys.Any((e) => string.Compare(e, it.Key) == 0) == false)
NotSavedLectotypeList.Add(it.Key, it.Value);
else NotSavedLectotypeList[it.Key]=it.Value;
}
);
}
public void RemoveNotSavedLectotype(Dictionary<string, string> value)
{