Changeset 3599 for trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3
- Timestamp:
- 05/03/10 17:46:09 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisProblemData.cs
r3563 r3599 46 46 } 47 47 48 public IValueParameter<CheckedItem Collection<StringValue>> InputVariablesParameter {49 get { return (IValueParameter<CheckedItem Collection<StringValue>>)Parameters["InputVariables"]; }48 public IValueParameter<CheckedItemList<StringValue>> InputVariablesParameter { 49 get { return (IValueParameter<CheckedItemList<StringValue>>)Parameters["InputVariables"]; } 50 50 } 51 51 … … 85 85 } 86 86 } 87 public CheckedItem Collection<StringValue> InputVariables {88 get { return (CheckedItem Collection<StringValue>)InputVariablesParameter.Value; }87 public CheckedItemList<StringValue> InputVariables { 88 get { return (CheckedItemList<StringValue>)InputVariablesParameter.Value; } 89 89 set { 90 90 if (value != InputVariables) { … … 140 140 : base() { 141 141 Parameters.Add(new ValueParameter<Dataset>("Dataset", new Dataset())); 142 Parameters.Add(new ValueParameter<CheckedItem Collection<StringValue>>("InputVariables", new CheckedItemCollection<StringValue>()));142 Parameters.Add(new ValueParameter<CheckedItemList<StringValue>>("InputVariables", new CheckedItemList<StringValue>())); 143 143 Parameters.Add(new ConstrainedValueParameter<StringValue>("TargetVariable")); 144 144 Parameters.Add(new ValueParameter<IntValue>("TrainingSamplesStart", new IntValue())); … … 249 249 250 250 private void RegisterInputVariablesEventHandlers() { 251 InputVariables.CollectionReset += new HeuristicLab.Collections.CollectionItemsChangedEventHandler< StringValue>(InputVariables_CollectionReset);252 InputVariables.ItemsAdded += new HeuristicLab.Collections.CollectionItemsChangedEventHandler< StringValue>(InputVariables_ItemsAdded);253 InputVariables.ItemsRemoved += new HeuristicLab.Collections.CollectionItemsChangedEventHandler< StringValue>(InputVariables_ItemsRemoved);254 InputVariables.CheckedItemsChanged += new HeuristicLab.Collections.CollectionItemsChangedEventHandler< StringValue>(InputVariables_ItemsChecked);251 InputVariables.CollectionReset += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<HeuristicLab.Collections.IndexedItem<StringValue>>(InputVariables_CollectionReset); 252 InputVariables.ItemsAdded += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<HeuristicLab.Collections.IndexedItem<StringValue>>(InputVariables_ItemsAdded); 253 InputVariables.ItemsRemoved += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<HeuristicLab.Collections.IndexedItem<StringValue>>(InputVariables_ItemsRemoved); 254 InputVariables.CheckedItemsChanged += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<HeuristicLab.Collections.IndexedItem<StringValue>>(InputVariables_CheckedItemsChanged); 255 255 foreach (var item in InputVariables) 256 256 item.ValueChanged += new EventHandler(InputVariable_ValueChanged); 257 257 } 258 258 259 void InputVariables_ItemsChecked(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<StringValue> e) {260 OnProblemDataChanged(e);261 }262 263 void InputVariables_ItemsRemoved(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<StringValue> e) {264 foreach (var item in e.Items)265 item.ValueChanged -= new EventHandler(InputVariable_ValueChanged);266 OnProblemDataChanged(e);267 }268 269 void InputVariables_CollectionReset(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<StringValue> e) {270 foreach (var item in e.OldItems)271 item.ValueChanged -= new EventHandler(InputVariable_ValueChanged);272 OnProblemDataChanged(e);273 }274 275 void InputVariables_ItemsAdded(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<StringValue> e) {276 foreach (var item in e.Items)277 item.ValueChanged += new EventHandler(InputVariable_ValueChanged);278 OnProblemDataChanged(e);279 }280 281 259 private void DeregisterInputVariablesEventHandlers() { 282 InputVariables.CollectionReset -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<StringValue>(InputVariables_CollectionReset); 283 InputVariables.ItemsAdded -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<StringValue>(InputVariables_ItemsAdded); 284 InputVariables.ItemsRemoved -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<StringValue>(InputVariables_ItemsRemoved); 260 InputVariables.CollectionReset -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<HeuristicLab.Collections.IndexedItem<StringValue>>(InputVariables_CollectionReset); 261 InputVariables.ItemsAdded -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<HeuristicLab.Collections.IndexedItem<StringValue>>(InputVariables_ItemsAdded); 262 InputVariables.ItemsRemoved -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<HeuristicLab.Collections.IndexedItem<StringValue>>(InputVariables_ItemsRemoved); 263 InputVariables.CheckedItemsChanged -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<HeuristicLab.Collections.IndexedItem<StringValue>>(InputVariables_CheckedItemsChanged); 285 264 foreach (var item in InputVariables) { 286 265 item.ValueChanged -= new EventHandler(InputVariable_ValueChanged); … … 288 267 } 289 268 269 private void InputVariables_CheckedItemsChanged(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<HeuristicLab.Collections.IndexedItem<StringValue>> e) { 270 OnProblemDataChanged(e); 271 } 272 273 private void InputVariables_ItemsRemoved(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<HeuristicLab.Collections.IndexedItem<StringValue>> e) { 274 foreach (var indexedItem in e.Items) 275 indexedItem.Value.ValueChanged -= new EventHandler(InputVariable_ValueChanged); 276 OnProblemDataChanged(e); 277 } 278 279 private void InputVariables_ItemsAdded(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<HeuristicLab.Collections.IndexedItem<StringValue>> e) { 280 foreach (var indexedItem in e.Items) 281 indexedItem.Value.ValueChanged += new EventHandler(InputVariable_ValueChanged); 282 OnProblemDataChanged(e); 283 } 284 285 private void InputVariables_CollectionReset(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<HeuristicLab.Collections.IndexedItem<StringValue>> e) { 286 foreach (var indexedItem in e.OldItems) 287 indexedItem.Value.ValueChanged -= new EventHandler(InputVariable_ValueChanged); 288 OnProblemDataChanged(e); 289 } 290 290 291 void InputVariable_ValueChanged(object sender, EventArgs e) { 291 292 OnProblemDataChanged(e); … … 328 329 ((ConstrainedValueParameter<StringValue>)TargetVariableParameter).ValidValues.Add(variableName); 329 330 TargetVariable = variableNames.First(); 330 InputVariables = new CheckedItem Collection<StringValue>(variableNames);331 InputVariables = new CheckedItemList<StringValue>(variableNames); 331 332 foreach (var variableName in variableNames.Skip(1)) 332 333 InputVariables.SetItemCheckedState(variableName, true);
Note: See TracChangeset
for help on using the changeset viewer.