Exemple #1
0
 private void OnCollectionChanged(DictionaryChangedEventArgs <K, V> args)
 {
     if (DictionaryChanged != null)
     {
         DictionaryChanged(args);
     }
 }
Exemple #2
0
        public V this[K key]
        {
            get { return(dictionary[key]); }
            set
            {
                DictionaryChangedEventArgs <K, V> .ChangedAction action = ContainsKey(key)
                    ? DictionaryChangedEventArgs <K, V> .ChangedAction.Replace
                    : DictionaryChangedEventArgs <K, V> .ChangedAction.Add;

                dictionary[key] = value;
                OnCollectionChanged(new DictionaryChangedEventArgs <K, V>(new KeyValuePair <K, V>(key, value), action));
            }
        }