Changeset 8535 for branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/ValueConfigurations/CheckedValueConfigurationCollection.cs
- Timestamp:
- 08/29/12 09:22:21 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/ValueConfigurations/CheckedValueConfigurationCollection.cs
r8517 r8535 28 28 29 29 namespace HeuristicLab.Encodings.ParameterConfigurationEncoding { 30 // todo: check that at least 1 elementsneeds to be selected31 // todo: control creatable item types30 // TODO: check that at least 1 element needs to be selected 31 // TODO: control creatable item types 32 32 [StorableClass] 33 33 public class CheckedValueConfigurationList : CheckedItemList<IValueConfiguration>, ICheckedValueConfigurationList { … … 44 44 } 45 45 46 public CheckedValueConfigurationList(IItemSet<IItem> validValues) { 47 this.validValues = validValues; 48 RegisterEvents(); 49 } 50 public CheckedValueConfigurationList(IEnumerable<IValueConfiguration> collection) 51 : base(collection) { 52 validValues = null; 53 // event wiring not needed 54 } 55 public CheckedValueConfigurationList() { 56 RegisterEvents(); 57 } 46 #region Constructors and Cloning 58 47 [StorableConstructor] 59 48 protected CheckedValueConfigurationList(bool deserializing) … … 67 56 RegisterEvents(); 68 57 } 69 58 public CheckedValueConfigurationList(IItemSet<IItem> validValues) 59 : base() { 60 this.validValues = validValues; 61 RegisterEvents(); 62 } 63 public CheckedValueConfigurationList(IEnumerable<IValueConfiguration> collection) 64 : base(collection) { 65 validValues = null; 66 // event wiring not needed 67 } 68 public CheckedValueConfigurationList() 69 : base() { 70 RegisterEvents(); 71 } 70 72 public override IDeepCloneable Clone(Cloner cloner) { 71 73 return new CheckedValueConfigurationList(this, cloner); … … 75 77 RegisterEvents(); 76 78 } 79 #endregion 77 80 78 81 private void RegisterEvents() { 79 82 this.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<IValueConfiguration>>(CheckedValueConfigurationList_ItemsAdded); 80 this.ItemsRemoved += new CollectionItemsChangedEventHandler<IndexedItem<IValueConfiguration>>(CheckedValueConfigurationList_ItemsRemoved);81 83 } 82 84 83 85 private void DeregisterEvents() { 84 this.ItemsRemoved -= new CollectionItemsChangedEventHandler<IndexedItem<IValueConfiguration>>(CheckedValueConfigurationList_ItemsRemoved);85 86 this.ItemsAdded -= new CollectionItemsChangedEventHandler<IndexedItem<IValueConfiguration>>(CheckedValueConfigurationList_ItemsAdded); 86 87 } … … 95 96 } 96 97 } 97 98 private void CheckedValueConfigurationList_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IndexedItem<IValueConfiguration>> e) {99 // auch collectionreset gehört berücksichtigt100 // funktioniert so nicht ganz, weil die view das hinzufügen nicht mitkriegt101 //if (this.Count < minItemCount) {102 // foreach (var item in e.Items) {103 // if (this.Count >= minItemCount)104 // break;105 // this.Add(item);106 // }107 //}108 }109 110 98 } 111 99 }
Note: See TracChangeset
for help on using the changeset viewer.