Changeset 3562 for trunk/sources
- Timestamp:
- 04/30/10 08:05:01 (14 years ago)
- Location:
- trunk/sources
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core.Views/3.3/CheckedItemCollectionView.cs
r3558 r3562 56 56 Content.ItemsRemoved -= new CollectionItemsChangedEventHandler<T>(Content_ItemsRemoved); 57 57 Content.CollectionReset -= new CollectionItemsChangedEventHandler<T>(Content_CollectionReset); 58 Content. ItemsChecked -= new CollectionItemsChangedEventHandler<T>(Content_ItemsChecked);58 Content.CheckedItemsChanged -= new CollectionItemsChangedEventHandler<T>(Content_ItemsChecked); 59 59 base.DeregisterContentEvents(); 60 60 } … … 64 64 Content.ItemsRemoved += new CollectionItemsChangedEventHandler<T>(Content_ItemsRemoved); 65 65 Content.CollectionReset += new CollectionItemsChangedEventHandler<T>(Content_CollectionReset); 66 Content. ItemsChecked += new CollectionItemsChangedEventHandler<T>(Content_ItemsChecked);66 Content.CheckedItemsChanged += new CollectionItemsChangedEventHandler<T>(Content_ItemsChecked); 67 67 } 68 68 … … 299 299 foreach (T item in e.Items) { 300 300 foreach (ListViewItem listViewItem in GetListViewItemsForItem(item)) { 301 if (listViewItem.Checked != Content.I sItemChecked(item))302 listViewItem.Checked = Content.I sItemChecked(item);301 if (listViewItem.Checked != Content.ItemChecked(item)) 302 listViewItem.Checked = Content.ItemChecked(item); 303 303 } 304 304 } -
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 } -
trunk/sources/HeuristicLab.Core/3.3/Interfaces/ICheckedItemCollection.cs
r3558 r3562 24 24 25 25 namespace HeuristicLab.Core { 26 public interface ICheckedItemCollection<T> : IItemCollection<T> , IItemwhere T : class, IItem {27 event CollectionItemsChangedEventHandler<T> ItemsChecked;26 public interface ICheckedItemCollection<T> : IItemCollection<T> where T : class, IItem { 27 event CollectionItemsChangedEventHandler<T> CheckedItemsChanged; 28 28 IEnumerable<T> CheckedItems { get; } 29 bool I sItemChecked(T item);29 bool ItemChecked(T item); 30 30 void SetItemCheckedState(T item, bool checkedState); 31 31 }
Note: See TracChangeset
for help on using the changeset viewer.