- Timestamp:
- 09/04/14 19:40:22 (10 years ago)
- Location:
- trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBoxPlotView.cs
r11171 r11344 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.ComponentModel; 24 25 using System.Linq; 25 26 using System.Windows.Forms; … … 92 93 protected virtual void RegisterRunEvents(IEnumerable<IRun> runs) { 93 94 foreach (IRun run in runs) 94 run. Changed += new EventHandler(run_Changed);95 run.PropertyChanged += run_PropertyChanged; 95 96 } 96 97 protected virtual void DeregisterRunEvents(IEnumerable<IRun> runs) { 97 98 foreach (IRun run in runs) 98 run. Changed -= new EventHandler(run_Changed);99 run.PropertyChanged -= run_PropertyChanged; 99 100 } 100 101 … … 133 134 } 134 135 } 135 private void run_ Changed(object sender,EventArgs e) {136 private void run_PropertyChanged(object sender, PropertyChangedEventArgs e) { 136 137 if (InvokeRequired) 137 this.Invoke( new EventHandler(run_Changed), sender, e);138 this.Invoke((Action<object, PropertyChangedEventArgs>)run_PropertyChanged, sender, e); 138 139 else if (!suppressUpdates) { 139 UpdateDataPoints(); 140 if (e.PropertyName == "Visible") 141 UpdateDataPoints(); 140 142 } 141 143 } -
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBubbleChartView.cs
r11171 r11344 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.ComponentModel; 24 25 using System.Drawing; 25 26 using System.Linq; … … 116 117 protected virtual void RegisterRunEvents(IEnumerable<IRun> runs) { 117 118 foreach (IRun run in runs) 118 run. Changed += new EventHandler(run_Changed);119 run.PropertyChanged += run_PropertyChanged; 119 120 } 120 121 protected virtual void DeregisterRunEvents(IEnumerable<IRun> runs) { 121 122 foreach (IRun run in runs) 122 run. Changed -= new EventHandler(run_Changed);123 run.PropertyChanged -= run_PropertyChanged; 123 124 } 124 125 … … 133 134 RegisterRunEvents(e.Items); 134 135 } 135 private void run_ Changed(object sender,EventArgs e) {136 private void run_PropertyChanged(object sender, PropertyChangedEventArgs e) { 136 137 if (suppressUpdates) return; 137 138 if (InvokeRequired) 138 this.Invoke( new EventHandler(run_Changed), sender, e);139 this.Invoke((Action<object, PropertyChangedEventArgs>)run_PropertyChanged, sender, e); 139 140 else { 140 IRun run = (IRun)sender; 141 UpdateRun(run); 142 UpdateCursorInterval(); 143 chart.ChartAreas[0].RecalculateAxesScale(); 144 UpdateAxisLabels(); 141 if (e.PropertyName == "Color" || e.PropertyName == "Visible") { 142 IRun run = (IRun)sender; 143 UpdateRun(run); 144 UpdateCursorInterval(); 145 chart.ChartAreas[0].RecalculateAxesScale(); 146 UpdateAxisLabels(); 147 } 145 148 } 146 149 } … … 670 673 if (xAxisValue != null) 671 674 xAxis.Title = xAxisValue; 672 if (yAxisValue != null)673 yAxis.Title = yAxisValue;675 if (yAxisValue != null) 676 yAxis.Title = yAxisValue; 674 677 } 675 678 -
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionChartAggregationView.cs
r11171 r11344 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.ComponentModel; 24 25 using System.Linq; 25 26 using System.Windows.Forms; … … 111 112 112 113 private void RegisterRunEvents(IRun run) { 113 run. Changed += new System.EventHandler(run_Changed);114 run.PropertyChanged += run_PropertyChanged; 114 115 } 115 116 private void DeregisterRunEvents(IRun run) { 116 run. Changed -= new System.EventHandler(run_Changed);117 } 118 private void run_ Changed(object sender,EventArgs e) {117 run.PropertyChanged -= run_PropertyChanged; 118 } 119 private void run_PropertyChanged(object sender, PropertyChangedEventArgs e) { 119 120 if (suppressUpdates) return; 120 var run = (IRun)sender; 121 UpdateRuns(new IRun[] { run }); 121 if (InvokeRequired) { 122 Invoke((Action<object, PropertyChangedEventArgs>)run_PropertyChanged, sender, e); 123 } else { 124 var run = (IRun)sender; 125 if (e.PropertyName == "Color" || e.PropertyName == "Visible") 126 UpdateRuns(new IRun[] { run }); 127 } 122 128 } 123 129 #endregion -
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionTableView.cs
r11171 r11344 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.ComponentModel; 24 25 using System.Linq; 25 26 using System.Windows.Forms; … … 70 71 private void RegisterRunEvents(IEnumerable<IRun> runs) { 71 72 foreach (IRun run in runs) 72 run. Changed += new EventHandler(run_Changed);73 run.PropertyChanged += run_PropertyChanged; 73 74 } 74 75 protected override void DeregisterContentEvents() { … … 83 84 private void DeregisterRunEvents(IEnumerable<IRun> runs) { 84 85 foreach (IRun run in runs) 85 run. Changed -= new EventHandler(run_Changed);86 run.PropertyChanged -= run_PropertyChanged; 86 87 } 87 88 private void Content_CollectionReset(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<IRun> e) { … … 100 101 else UpdateCaption(); 101 102 } 102 private void run_ Changed(object sender,EventArgs e) {103 private void run_PropertyChanged(object sender, PropertyChangedEventArgs e) { 103 104 if (suppressUpdates) return; 104 105 if (InvokeRequired) 105 this.Invoke( new EventHandler(run_Changed), sender, e);106 this.Invoke((Action<object, PropertyChangedEventArgs>)run_PropertyChanged, sender, e); 106 107 else { 107 108 IRun run = (IRun)sender; 108 UpdateRun(run); 109 if (e.PropertyName == "Color" || e.PropertyName == "Visible") 110 UpdateRun(run); 109 111 } 110 112 } -
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionView.cs
r11171 r11344 23 23 using System.Collections; 24 24 using System.Collections.Generic; 25 using System.ComponentModel; 25 26 using System.Drawing; 26 27 using System.Linq; … … 79 80 item.ItemImageChanged -= new EventHandler(Item_ItemImageChanged); 80 81 item.ToStringChanged -= new EventHandler(Item_ToStringChanged); 81 item. Changed -= new EventHandler(Item_Changed);82 item.PropertyChanged -= Item_PropertyChanged; 82 83 } 83 84 private void RegisterItemEvents(IRun item) { 84 85 item.ItemImageChanged += new EventHandler(Item_ItemImageChanged); 85 86 item.ToStringChanged += new EventHandler(Item_ToStringChanged); 86 item. Changed += new EventHandler(Item_Changed);87 item.PropertyChanged += Item_PropertyChanged; 87 88 } 88 89 … … 385 386 try { 386 387 RunCollection.Modify(); 387 } 388 finally { 388 } finally { 389 389 ReadOnly = false; 390 390 } … … 462 462 } 463 463 } 464 private void Item_ Changed(object sender,EventArgs e) {464 private void Item_PropertyChanged(object sender, PropertyChangedEventArgs e) { 465 465 if (InvokeRequired) 466 this.Invoke( new EventHandler(Item_Changed), sender, e);466 this.Invoke((Action<object, PropertyChangedEventArgs>)Item_PropertyChanged, sender, e); 467 467 else { 468 468 IRun run = (IRun)sender; 469 UpdateRun(run); 469 if (e.PropertyName == "Color" || e.PropertyName == "Visible") 470 UpdateRun(run); 470 471 } 471 472 }
Note: See TracChangeset
for help on using the changeset viewer.