Changeset 3562 for trunk/sources/HeuristicLab.Core/3.3/Collections
- Timestamp:
- 04/30/10 08:05:01 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core/3.3/Collections/CheckedItemCollection.cs
r3560 r3562 60 60 protected CheckedItemCollection(bool deserializing) : base(deserializing) { } 61 61 62 public bool I sItemChecked(T item) {62 public bool ItemChecked(T item) { 63 63 return checkedState[item]; 64 64 } … … 76 76 checkedState.Remove(oldItem); 77 77 foreach (var item in items) 78 checkedState.Add(item, false); 78 if (!checkedState.ContainsKey(item)) 79 checkedState.Add(item, false); 79 80 base.OnCollectionReset(items, oldItems); 80 81 } … … 82 83 protected override void OnItemsAdded(IEnumerable<T> items) { 83 84 foreach (var item in items) 84 checkedState.Add(item, false); 85 if (!checkedState.ContainsKey(item)) 86 checkedState.Add(item, false); 85 87 base.OnItemsAdded(items); 86 88 } … … 94 96 95 97 protected virtual void OnItemsChecked(IEnumerable<T> items) { 96 Raise ItemsChecked(new CollectionItemsChangedEventArgs<T>(items));98 RaiseCheckedItemsChanged(new CollectionItemsChangedEventArgs<T>(items)); 97 99 } 98 100 99 public event CollectionItemsChangedEventHandler<T> ItemsChecked;100 private void Raise ItemsChecked(CollectionItemsChangedEventArgs<T> e) {101 var handler = ItemsChecked;101 public event CollectionItemsChangedEventHandler<T> CheckedItemsChanged; 102 private void RaiseCheckedItemsChanged(CollectionItemsChangedEventArgs<T> e) { 103 var handler = CheckedItemsChanged; 102 104 if (handler != null) handler(this, e); 103 105 }
Note: See TracChangeset
for help on using the changeset viewer.