Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/04/17 16:33:37 (7 years ago)
Author:
gkronber
Message:

#2650: merged r14504:14533 from trunk to branch

Location:
branches/symbreg-factors-2650
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/symbreg-factors-2650

  • branches/symbreg-factors-2650/HeuristicLab.Analysis.Views

  • branches/symbreg-factors-2650/HeuristicLab.Analysis.Views/3.3/DataTableControl.cs

    r14498 r14542  
    2727using System.Windows.Forms.DataVisualization.Charting;
    2828using HeuristicLab.Collections;
     29using HeuristicLab.MainForm.WindowsForms;
    2930
    3031namespace HeuristicLab.Analysis.Views {
    31   public partial class DataTableControl : UserControl {
     32  public partial class DataTableControl : AsynchronousContentView {
    3233    protected List<Series> invisibleSeries;
    3334    protected Dictionary<IObservableList<double>, DataRow> valuesRowsTable;
    3435
    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; }
    4639    }
    4740
     
    5649
    5750    #region Event Handler Registration
    58     protected virtual void DeregisterContentEvents() {
     51    protected override void DeregisterContentEvents() {
    5952      foreach (DataRow row in Content.Rows)
    6053        DeregisterDataRowEvents(row);
     
    6558      Content.Rows.CollectionReset -= new CollectionItemsChangedEventHandler<DataRow>(Rows_CollectionReset);
    6659    }
    67     protected virtual void RegisterContentEvents() {
     60    protected override void RegisterContentEvents() {
    6861      Content.VisualPropertiesChanged += new EventHandler(Content_VisualPropertiesChanged);
    6962      Content.Rows.ItemsAdded += new CollectionItemsChangedEventHandler<DataRow>(Rows_ItemsAdded);
     
    9588    #endregion
    9689
    97     protected virtual void OnContentChanged() {
     90    protected override void OnContentChanged() {
    9891      invisibleSeries.Clear();
    9992      chart.Titles[0].Text = string.Empty;
     
    111104    }
    112105
    113     protected virtual void SetEnabledStateOfControls() {
     106    protected override void SetEnabledStateOfControls() {
    114107      chart.Enabled = Content != null;
    115108    }
     
    541534      if (!row.Values.Any()) return;
    542535
     536      var validValues = histogramRows.SelectMany(r => r.Values).Where(x => !IsInvalidValue(x)).ToList();
     537      if (!validValues.Any()) return;
     538
    543539      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();
    546542      decimal intervalWidth = (maxValue - minValue) / bins;
    547543      if (intervalWidth < 0) return;
Note: See TracChangeset for help on using the changeset viewer.