private void BuildDictionaryHierarchyTrees(IDictionary <string, ILocalizationDictionary> dictionaries, ILocalizationDictionary dictionary) { if (dictionary.Scope() == GlobalScope) { return; } var parentScope = string.IsNullOrEmpty(dictionary.GetParentScopeName()) ? dictionaries[GlobalScope] : dictionaries[dictionary.GetParentScopeName()]; dictionary.SetParentDictionary(parentScope); }
private void AddDictionaryToHierarchyTreesWithoutBuildTree(ILocalizationDictionary dictionary) { m_dictionaries.Add(dictionary); if (!m_dictionariesPerCultureAndScope.Keys.Contains(dictionary.CultureInfo())) { throw new DictionaryLoadException(string.Format(UnknownCultureException, dictionary.CultureInfo(), dictionary.Scope())); } var dictionariesPerCulture = m_dictionariesPerCultureAndScope[dictionary.CultureInfo()]; dictionariesPerCulture.Add(dictionary.Scope(), dictionary); foreach (var scopeAlias in dictionary.ScopeAlias()) { dictionariesPerCulture.Add(scopeAlias, dictionary); } }