using System.Collections.Generic; namespace TeamAAS.FlowEngine { /// /// 集合扩展方法。 /// 背景:DeleteIfExistsKey 原先来自 HandyControls fork 的 HandyControl.Tools.Extension, /// 切换到官方 HandyControl 后由本文件补齐等价实现,避免依赖 fork 包。 /// public static class DictionaryExtensions { /// 存在则删除指定键,不存在则静默跳过 public static bool DeleteIfExistsKey(this Dictionary dictionary, TKey key) { if (dictionary == null || key == null) return false; return dictionary.Remove(key); } } }