private void CopyDictionary(ResourceDic source, ResourceDic target) { using (var enumerator = source.GetEnumerator()) { while (enumerator.MoveNext()) { target[enumerator.Current.Key] = enumerator.Current.Value; SetAcitveKey(target, enumerator.Current.Key); } } }
/// <summary> /// 更新资源字典 /// </summary> /// <param name="resourceDic"></param> /// <param name="newResourceDic"></param> private void UpdateResourceDic(ResourceDic resourceDic, ResourceDic newResourceDic) { if (newResourceDic.Count == 0) { return; } using (var enumerator = newResourceDic.GetEnumerator()) { while (enumerator.MoveNext()) { var current = enumerator.Current; resourceDic[current.Key] = current.Value; } } }