Changeset 11697 for branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/CorrelationView.cs
- Timestamp:
- 12/18/14 16:55:53 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/CorrelationView.cs
r11644 r11697 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HeuristicLab.Collections;26 using HeuristicLab.Core;27 25 using HeuristicLab.Core.Views; 28 26 using HeuristicLab.Data; … … 80 78 protected override void RegisterContentEvents() { 81 79 base.RegisterContentEvents(); 82 Content. ItemsAdded += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_ItemsAdded);83 Content. ItemsRemoved += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved);80 Content.ColumnsChanged += Content_ColumnsChanged; 81 Content.RowsChanged += Content_RowsChanged; 84 82 Content.CollectionReset += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset); 85 83 Content.UpdateOfRunsInProgressChanged += Content_UpdateOfRunsInProgressChanged; 86 RegisterRunEvents(Content);87 84 } 88 85 89 86 protected override void DeregisterContentEvents() { 90 87 base.DeregisterContentEvents(); 91 Content. ItemsAdded -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_ItemsAdded);92 Content. ItemsRemoved -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved);88 Content.ColumnsChanged -= Content_ColumnsChanged; 89 Content.RowsChanged -= Content_RowsChanged; 93 90 Content.CollectionReset -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset); 94 91 Content.UpdateOfRunsInProgressChanged -= Content_UpdateOfRunsInProgressChanged; 95 DeregisterRunEvents(Content); 96 } 97 98 private void RegisterRunEvents(IEnumerable<IRun> runs) { 99 foreach (IRun run in runs) { 100 RegisterRunResultsEvents(run); 101 RegisterRunParametersEvents(run); 102 run.PropertyChanged += run_PropertyChanged; 103 } 104 } 105 106 private void DeregisterRunEvents(IEnumerable<IRun> runs) { 107 foreach (IRun run in runs) { 108 DeregisterRunResultsEvents(run); 109 DeregisterRunParametersEvents(run); 110 run.PropertyChanged -= run_PropertyChanged; 111 } 112 } 113 114 private void RegisterRunResultsEvents(IRun run) { 115 IObservableDictionary<string, IItem> dict = run.Results; 116 dict.ItemsAdded += run_Changed; 117 dict.ItemsRemoved += run_Changed; 118 dict.ItemsReplaced += run_Changed; 119 dict.CollectionReset += run_Changed; 120 } 121 122 private void DeregisterRunResultsEvents(IRun run) { 123 IObservableDictionary<string, IItem> dict = run.Results; 124 dict.ItemsAdded -= run_Changed; 125 dict.ItemsRemoved -= run_Changed; 126 dict.ItemsReplaced -= run_Changed; 127 dict.CollectionReset -= run_Changed; 128 } 129 130 private void RegisterRunParametersEvents(IRun run) { 131 IObservableDictionary<string, IItem> dict = run.Parameters; 132 dict.ItemsAdded += run_Changed; 133 dict.ItemsRemoved += run_Changed; 134 dict.ItemsReplaced += run_Changed; 135 dict.CollectionReset += run_Changed; 136 } 137 138 private void DeregisterRunParametersEvents(IRun run) { 139 IObservableDictionary<string, IItem> dict = run.Parameters; 140 dict.ItemsAdded -= run_Changed; 141 dict.ItemsRemoved -= run_Changed; 142 dict.ItemsReplaced -= run_Changed; 143 dict.CollectionReset -= run_Changed; 92 } 93 94 void Content_RowsChanged(object sender, EventArgs e) { 95 UpdateUI(); 96 } 97 98 void Content_ColumnsChanged(object sender, EventArgs e) { 99 UpdateUI(); 144 100 } 145 101 146 102 private void Content_CollectionReset(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<IRun> e) { 147 DeregisterRunEvents(e.OldItems);148 RegisterRunEvents(e.Items);149 UpdateUI();150 }151 152 private void Content_ItemsRemoved(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<IRun> e) {153 DeregisterRunEvents(e.Items);154 UpdateUI();155 }156 157 private void Content_ItemsAdded(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<IRun> e) {158 RegisterRunEvents(e.Items);159 103 UpdateUI(); 160 104 } … … 162 106 private void Content_UpdateOfRunsInProgressChanged(object sender, EventArgs e) { 163 107 suppressUpdates = Content.UpdateOfRunsInProgress; 164 UpdateUI();165 }166 167 private void run_Changed(object sender, EventArgs e) {168 if (InvokeRequired) {169 Invoke(new EventHandler(run_Changed), sender, e);170 }171 UpdateUI();172 }173 174 void run_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) {175 108 UpdateUI(); 176 109 }
Note: See TracChangeset
for help on using the changeset viewer.