Beispiel #1
0
 public virtual TValue this[TKey key]
 {
     get { return(internalDictionary[key]); }
     set
     {
         TValue oldVal;
         if (internalDictionary.TryGetValue(key, out oldVal))
         {
             DictionaryItemUpdateEventArgs <TKey, TValue> e = new DictionaryItemUpdateEventArgs <TKey, TValue>(key, oldVal, value);
             OnItemUpdating(e);
             internalDictionary[key] = value;
             OnItemUpdated(e);
         }
         else
         {
             Add(key, value);
         }
     }
 }
Beispiel #2
0
 protected virtual void OnItemUpdated(DictionaryItemUpdateEventArgs <TKey, TValue> e)
 {
     SyncEvent.Invoke(ItemUpdated, this, e);
 }