Changeset 5542
- Timestamp:
- 02/22/11 17:19:17 (14 years ago)
- Location:
- branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/DataAnalysisProblemData.cs
r5540 r5542 174 174 #region changed event propagation 175 175 private void RegisterEventHandlers() { 176 DatasetParameter.ValueChanged += new EventHandler(DatasetParameter_ValueChanged); 177 TrainingSamplesStartParameter.ValueChanged += new EventHandler(TrainingSamplesStartParameter_ValueChanged); 178 TrainingSamplesEndParameter.ValueChanged += new EventHandler(TrainingSamplesEndParameter_ValueChanged); 179 TestSamplesStartParameter.ValueChanged += new EventHandler(TestSamplesStartParameter_ValueChanged); 180 TestSamplesEndParameter.ValueChanged += new EventHandler(TestSamplesEndParameter_ValueChanged); 181 176 182 DatasetParameter.Value.Reset += new EventHandler(DatasetChanged); 177 183 DatasetParameter.Value.ColumnsChanged += new EventHandler(DatasetChanged); … … 184 190 InputVariablesParameter.Value.ItemsReplaced += new Collections.CollectionItemsChangedEventHandler<Collections.IndexedItem<StringValue>>(InputVariables_ItemsReplaced); 185 191 186 TrainingSamplesStartParameter.ValueChanged += new EventHandler(TrainingSamplesStartParameter_ValueChanged);187 TrainingSamplesEndParameter.ValueChanged += new EventHandler(TrainingSamplesEndParameter_ValueChanged);188 TestSamplesStartParameter.ValueChanged += new EventHandler(TestSamplesStartParameter_ValueChanged);189 TestSamplesEndParameter.ValueChanged += new EventHandler(TestSamplesEndParameter_ValueChanged);190 191 192 TrainingSamplesStartParameter.Value.ValueChanged += new EventHandler(Partitions_ValueChanged); 192 193 TrainingSamplesEndParameter.Value.ValueChanged += new EventHandler(Partitions_ValueChanged); … … 195 196 } 196 197 198 private void DatasetParameter_ValueChanged(object sender, EventArgs e) { 199 DatasetParameter.Value.Reset += new EventHandler(DatasetChanged); 200 DatasetParameter.Value.ColumnsChanged += new EventHandler(DatasetChanged); 201 DatasetParameter.Value.RowsChanged += new EventHandler(DatasetChanged); 202 OnProblemChanged(); 203 } 204 197 205 private void TestSamplesEndParameter_ValueChanged(object sender, EventArgs e) { 198 206 TestSamplesEndParameter.Value.ValueChanged += new EventHandler(Partitions_ValueChanged); 207 OnProblemChanged(); 199 208 } 200 209 201 210 private void TestSamplesStartParameter_ValueChanged(object sender, EventArgs e) { 202 211 TestSamplesStartParameter.Value.ValueChanged += new EventHandler(Partitions_ValueChanged); 212 OnProblemChanged(); 203 213 } 204 214 205 215 private void TrainingSamplesEndParameter_ValueChanged(object sender, EventArgs e) { 206 216 TrainingSamplesEndParameter.Value.ValueChanged += new EventHandler(Partitions_ValueChanged); 217 OnProblemChanged(); 207 218 } 208 219 209 220 private void TrainingSamplesStartParameter_ValueChanged(object sender, EventArgs e) { 210 221 TrainingSamplesStartParameter.Value.ValueChanged += new EventHandler(Partitions_ValueChanged); 222 OnProblemChanged(); 211 223 } 212 224 … … 243 255 } 244 256 245 protected v oid OnProblemChanged() {257 protected virtual void OnProblemChanged() { 246 258 var listeners = Changed; 247 259 if (listeners != null) listeners(this, EventArgs.Empty); -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/RegressionProblemData.cs
r5540 r5542 49 49 private RegressionProblemData(RegressionProblemData original, Cloner cloner) 50 50 : base(original, cloner) { 51 RegisterEventHandlers(); 51 52 } 52 53 [StorableConstructor] … … 60 61 61 62 Parameters.Add(targetVariableParameter); 63 64 RegisterEventHandlers(); 62 65 } 63 66 … … 65 68 return new RegressionProblemData(this, cloner); 66 69 } 70 71 [StorableHook(HookType.AfterDeserialization)] 72 private void AfterDeserialization() { 73 RegisterEventHandlers(); 74 } 75 76 #region event propagation 77 private void RegisterEventHandlers() { 78 TargetVariableParameter.Value.ValueChanged += new EventHandler(TargetVariable_ValueChanged); 79 TargetVariableParameter.ValueChanged += new EventHandler(TargetVariableParameter_ValueChanged); 80 } 81 82 private void TargetVariableParameter_ValueChanged(object sender, EventArgs e) { 83 TargetVariableParameter.Value.ValueChanged += new EventHandler(TargetVariable_ValueChanged); 84 OnProblemChanged(); 85 } 86 87 private void TargetVariable_ValueChanged(object sender, EventArgs e) { 88 OnProblemChanged(); 89 } 90 #endregion 67 91 } 68 92 }
Note: See TracChangeset
for help on using the changeset viewer.