Changeset 14542 for branches/symbreg-factors-2650/HeuristicLab.Analysis.Views/3.3/DataTableControl.cs
- Timestamp:
- 01/04/17 16:33:37 (7 years ago)
- Location:
- branches/symbreg-factors-2650
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/symbreg-factors-2650
- Property svn:mergeinfo changed
/trunk/sources merged: 14504,14506-14509,14516-14517,14519,14522-14523,14527-14529,14531-14533
- Property svn:mergeinfo changed
-
branches/symbreg-factors-2650/HeuristicLab.Analysis.Views
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Analysis.Views merged: 14508,14516,14519
- Property svn:mergeinfo changed
-
branches/symbreg-factors-2650/HeuristicLab.Analysis.Views/3.3/DataTableControl.cs
r14498 r14542 27 27 using System.Windows.Forms.DataVisualization.Charting; 28 28 using HeuristicLab.Collections; 29 using HeuristicLab.MainForm.WindowsForms; 29 30 30 31 namespace HeuristicLab.Analysis.Views { 31 public partial class DataTableControl : UserControl{32 public partial class DataTableControl : AsynchronousContentView { 32 33 protected List<Series> invisibleSeries; 33 34 protected Dictionary<IObservableList<double>, DataRow> valuesRowsTable; 34 35 35 private DataTable content; 36 public DataTable Content { 37 get { return content; } 38 set { 39 if (value == content) return; 40 if (content != null) DeregisterContentEvents(); 41 content = value; 42 if (content != null) RegisterContentEvents(); 43 OnContentChanged(); 44 SetEnabledStateOfControls(); 45 } 36 public new DataTable Content { 37 get { return (DataTable)base.Content; } 38 set { base.Content = value; } 46 39 } 47 40 … … 56 49 57 50 #region Event Handler Registration 58 protected virtualvoid DeregisterContentEvents() {51 protected override void DeregisterContentEvents() { 59 52 foreach (DataRow row in Content.Rows) 60 53 DeregisterDataRowEvents(row); … … 65 58 Content.Rows.CollectionReset -= new CollectionItemsChangedEventHandler<DataRow>(Rows_CollectionReset); 66 59 } 67 protected virtualvoid RegisterContentEvents() {60 protected override void RegisterContentEvents() { 68 61 Content.VisualPropertiesChanged += new EventHandler(Content_VisualPropertiesChanged); 69 62 Content.Rows.ItemsAdded += new CollectionItemsChangedEventHandler<DataRow>(Rows_ItemsAdded); … … 95 88 #endregion 96 89 97 protected virtualvoid OnContentChanged() {90 protected override void OnContentChanged() { 98 91 invisibleSeries.Clear(); 99 92 chart.Titles[0].Text = string.Empty; … … 111 104 } 112 105 113 protected virtualvoid SetEnabledStateOfControls() {106 protected override void SetEnabledStateOfControls() { 114 107 chart.Enabled = Content != null; 115 108 } … … 541 534 if (!row.Values.Any()) return; 542 535 536 var validValues = histogramRows.SelectMany(r => r.Values).Where(x => !IsInvalidValue(x)).ToList(); 537 if (!validValues.Any()) return; 538 543 539 int bins = histogramRows.Max(r => r.VisualProperties.Bins); 544 decimal minValue = (decimal) histogramRows.Min(r => r.Values.Min());545 decimal maxValue = (decimal) histogramRows.Max(r => r.Values.Max());540 decimal minValue = (decimal)validValues.Min(); 541 decimal maxValue = (decimal)validValues.Max(); 546 542 decimal intervalWidth = (maxValue - minValue) / bins; 547 543 if (intervalWidth < 0) return;
Note: See TracChangeset
for help on using the changeset viewer.