Changeset 11345
- Timestamp:
- 09/05/14 10:38:42 (10 years ago)
- Location:
- trunk/sources
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunView.cs
r11344 r11345 67 67 private void RegisterContentParametersEvents() { 68 68 Content.Parameters.ItemsAdded += ParametersOnItemsChanged; 69 Content.Parameters.ItemsRemoved += ParametersOnItems Changed;69 Content.Parameters.ItemsRemoved += ParametersOnItemsRemoved; 70 70 Content.Parameters.ItemsReplaced += ParametersOnItemsChanged; 71 71 Content.Parameters.CollectionReset += ParametersOnItemsChanged; … … 73 73 private void RegisterContentResultsEents() { 74 74 Content.Results.ItemsAdded += ResultsOnItemsChanged; 75 Content.Results.ItemsRemoved += ResultsOnItems Changed;75 Content.Results.ItemsRemoved += ResultsOnItemsRemoved; 76 76 Content.Results.ItemsReplaced += ResultsOnItemsChanged; 77 77 Content.Results.CollectionReset += ResultsOnItemsChanged; … … 85 85 private void DeregisterContentParametersEvents() { 86 86 Content.Parameters.ItemsAdded -= ParametersOnItemsChanged; 87 Content.Parameters.ItemsRemoved -= ParametersOnItems Changed;87 Content.Parameters.ItemsRemoved -= ParametersOnItemsRemoved; 88 88 Content.Parameters.ItemsReplaced -= ParametersOnItemsChanged; 89 89 Content.Parameters.CollectionReset -= ParametersOnItemsChanged; … … 91 91 private void DeregisterContentResultsEvents() { 92 92 Content.Results.ItemsAdded -= ResultsOnItemsChanged; 93 Content.Results.ItemsRemoved -= ResultsOnItems Changed;93 Content.Results.ItemsRemoved -= ResultsOnItemsRemoved; 94 94 Content.Results.ItemsReplaced -= ResultsOnItemsChanged; 95 95 Content.Results.CollectionReset -= ResultsOnItemsChanged; … … 123 123 } 124 124 125 private void ParametersOnItemsRemoved(object sender, CollectionItemsChangedEventArgs<KeyValuePair<string, IItem>> e) { 126 foreach (var item in e.Items) { 127 listView.Items.Remove(parametersItemToListViewItem[item.Key]); 128 parametersItemToListViewItem.Remove(item.Key); 129 } 130 } 131 125 132 private void ResultsOnItemsChanged(object sender, CollectionItemsChangedEventArgs<KeyValuePair<string, IItem>> e) { 126 133 foreach (var item in e.OldItems) { … … 132 139 listView.Items.Add(listViewItem); 133 140 resultsItemToListViewItem[item.Key] = listViewItem; 141 } 142 } 143 144 private void ResultsOnItemsRemoved(object sender, CollectionItemsChangedEventArgs<KeyValuePair<string, IItem>> e) { 145 foreach (var item in e.Items) { 146 listView.Items.Remove(resultsItemToListViewItem[item.Key]); 147 resultsItemToListViewItem.Remove(item.Key); 134 148 } 135 149 } -
trunk/sources/HeuristicLab.Optimization/3.3/RunCollection.cs
r11344 r11345 237 237 IObservableDictionary<string, IItem> dict = run.Parameters; 238 238 dict.ItemsAdded += RunOnParameterChanged; 239 dict.ItemsRemoved += RunOnParameter Changed;239 dict.ItemsRemoved += RunOnParameterRemoved; 240 240 dict.ItemsReplaced += RunOnParameterChanged; 241 241 dict.CollectionReset += RunOnParameterChanged; … … 245 245 IObservableDictionary<string, IItem> dict = run.Results; 246 246 dict.ItemsAdded += RunOnResultChanged; 247 dict.ItemsRemoved += RunOnResult Changed;247 dict.ItemsRemoved += RunOnResultRemoved; 248 248 dict.ItemsReplaced += RunOnResultChanged; 249 249 dict.CollectionReset += RunOnResultChanged; … … 253 253 IObservableDictionary<string, IItem> dict = run.Parameters; 254 254 dict.ItemsAdded -= RunOnParameterChanged; 255 dict.ItemsRemoved -= RunOnParameter Changed;255 dict.ItemsRemoved -= RunOnParameterRemoved; 256 256 dict.ItemsReplaced -= RunOnParameterChanged; 257 257 dict.CollectionReset -= RunOnParameterChanged; … … 261 261 IObservableDictionary<string, IItem> dict = run.Results; 262 262 dict.ItemsAdded -= RunOnResultChanged; 263 dict.ItemsRemoved -= RunOnResult Changed;263 dict.ItemsRemoved -= RunOnResultRemoved; 264 264 dict.ItemsReplaced -= RunOnResultChanged; 265 265 dict.CollectionReset -= RunOnResultChanged; … … 280 280 } 281 281 282 private void RunOnParameterRemoved(object sender, CollectionItemsChangedEventArgs<KeyValuePair<string, IItem>> e) { 283 bool columnsChanged = false; 284 foreach (var param in e.Items) 285 columnsChanged |= RemoveParameterName(param.Key); 286 if (columnsChanged) columnNameCache = null; 287 OnReset(); 288 if (columnsChanged) { 289 OnColumnsChanged(); 290 OnColumnNamesChanged(); 291 } 292 } 293 282 294 private void RunOnResultChanged(object sender, CollectionItemsChangedEventArgs<KeyValuePair<string, IItem>> e) { 283 295 bool columnsChanged = false; … … 285 297 columnsChanged |= AddResult(result.Key, result.Value); 286 298 foreach (var result in e.OldItems) 299 columnsChanged |= RemoveResultName(result.Key); 300 if (columnsChanged) columnNameCache = null; 301 OnReset(); 302 if (columnsChanged) { 303 OnColumnsChanged(); 304 OnColumnNamesChanged(); 305 } 306 } 307 308 private void RunOnResultRemoved(object sender, CollectionItemsChangedEventArgs<KeyValuePair<string, IItem>> e) { 309 bool columnsChanged = false; 310 foreach (var result in e.Items) 287 311 columnsChanged |= RemoveResultName(result.Key); 288 312 if (columnsChanged) columnNameCache = null;
Note: See TracChangeset
for help on using the changeset viewer.