public object this[string index]
 {
     get
     {
         if (_innerDictionary.ContainsKey(index))
         {
             return(_innerDictionary[index]);
         }
         if (_mergedInstance != null && _mergedInstance.ContainsKey(index))
         {
             return(_mergedInstance[index]);
         }
         if (MergedDictionaries != null)
         {
             foreach (var dict in MergedDictionaries.Reverse())
             {
                 if (dict.ContainsKey(index))
                 {
                     return(dict[index]);
                 }
             }
         }
         throw new KeyNotFoundException($"The resource '{index}' is not present in the dictionary.");
     }
     set
     {
         _innerDictionary[index] = value;
         OnValueChanged(index, value);
     }
 }
Ejemplo n.º 2
0
 public object this[string index]
 {
     get
     {
         if (_innerDictionary.ContainsKey(index))
         {
             return(_innerDictionary[index]);
         }
         if (_mergedInstance != null && _mergedInstance.ContainsKey(index))
         {
             return(_mergedInstance[index]);
         }
         throw new KeyNotFoundException();
     }
     set
     {
         _innerDictionary[index] = value;
         OnValueChanged(index, value);
     }
 }
Ejemplo n.º 3
0
 public bool ContainsKey(string key)
 {
     return(_innerDictionary.ContainsKey(key) || (_mergedInstance != null && _mergedInstance.ContainsKey(key)));
 }