- Timestamp:
- 12/28/09 21:38:15 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Collections/3.3/ObservableDictionary.cs
r2573 r2574 30 30 namespace HeuristicLab.Collections { 31 31 [Serializable] 32 public class ObservableDictionary<TKey, TValue> : CollectionChangedEventsBase<KeyValuePair<TKey, TValue>>, IDictionary<TKey, TValue> {32 public class ObservableDictionary<TKey, TValue> : IObservableDictionary<TKey, TValue> { 33 33 [Storable] 34 34 private Dictionary<TKey, TValue> dict; … … 156 156 } 157 157 #endregion 158 159 #region Events 160 [field: NonSerialized] 161 public event CollectionItemsChangedEventHandler<KeyValuePair<TKey, TValue>> ItemsAdded; 162 protected virtual void OnItemsAdded(IEnumerable<KeyValuePair<TKey, TValue>> items) { 163 if (ItemsAdded != null) 164 ItemsAdded(this, new CollectionItemsChangedEventArgs<KeyValuePair<TKey, TValue>>(items)); 165 } 166 167 [field: NonSerialized] 168 public event CollectionItemsChangedEventHandler<KeyValuePair<TKey, TValue>> ItemsRemoved; 169 protected virtual void OnItemsRemoved(IEnumerable<KeyValuePair<TKey, TValue>> items) { 170 if (ItemsRemoved != null) 171 ItemsRemoved(this, new CollectionItemsChangedEventArgs<KeyValuePair<TKey, TValue>>(items)); 172 } 173 174 [field: NonSerialized] 175 public event CollectionItemsChangedEventHandler<KeyValuePair<TKey, TValue>> ItemsReplaced; 176 protected virtual void OnItemsReplaced(IEnumerable<KeyValuePair<TKey, TValue>> items, IEnumerable<KeyValuePair<TKey, TValue>> oldItems) { 177 if (ItemsReplaced != null) 178 ItemsReplaced(this, new CollectionItemsChangedEventArgs<KeyValuePair<TKey, TValue>>(items, oldItems)); 179 } 180 181 [field: NonSerialized] 182 public event CollectionItemsChangedEventHandler<KeyValuePair<TKey, TValue>> CollectionReset; 183 protected virtual void OnCollectionReset(IEnumerable<KeyValuePair<TKey, TValue>> items, IEnumerable<KeyValuePair<TKey, TValue>> oldItems) { 184 if (CollectionReset != null) 185 CollectionReset(this, new CollectionItemsChangedEventArgs<KeyValuePair<TKey, TValue>>(items, oldItems)); 186 } 187 #endregion 158 188 } 159 189 }
Note: See TracChangeset
for help on using the changeset viewer.