Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/30/10 08:05:01 (15 years ago)
Author:
gkronber
Message:

Implemented changes as requested by swagner. #992 (CheckedItemList and CheckedItemCollection is necessary)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Core/3.3/Collections/CheckedItemCollection.cs

    r3560 r3562  
    6060    protected CheckedItemCollection(bool deserializing) : base(deserializing) { }
    6161
    62     public bool IsItemChecked(T item) {
     62    public bool ItemChecked(T item) {
    6363      return checkedState[item];
    6464    }
     
    7676        checkedState.Remove(oldItem);
    7777      foreach (var item in items)
    78         checkedState.Add(item, false);
     78        if (!checkedState.ContainsKey(item))
     79          checkedState.Add(item, false);
    7980      base.OnCollectionReset(items, oldItems);
    8081    }
     
    8283    protected override void OnItemsAdded(IEnumerable<T> items) {
    8384      foreach (var item in items)
    84         checkedState.Add(item, false);
     85        if (!checkedState.ContainsKey(item))
     86          checkedState.Add(item, false);
    8587      base.OnItemsAdded(items);
    8688    }
     
    9496
    9597    protected virtual void OnItemsChecked(IEnumerable<T> items) {
    96       RaiseItemsChecked(new CollectionItemsChangedEventArgs<T>(items));
     98      RaiseCheckedItemsChanged(new CollectionItemsChangedEventArgs<T>(items));
    9799    }
    98100
    99     public event CollectionItemsChangedEventHandler<T> ItemsChecked;
    100     private void RaiseItemsChecked(CollectionItemsChangedEventArgs<T> e) {
    101       var handler = ItemsChecked;
     101    public event CollectionItemsChangedEventHandler<T> CheckedItemsChanged;
     102    private void RaiseCheckedItemsChanged(CollectionItemsChangedEventArgs<T> e) {
     103      var handler = CheckedItemsChanged;
    102104      if (handler != null) handler(this, e);
    103105    }
Note: See TracChangeset for help on using the changeset viewer.