Free cookie consent management tool by TermsFeed Policy Generator

Changeset 15042 for trunk


Ignore:
Timestamp:
06/21/17 16:17:57 (7 years ago)
Author:
pfleck
Message:

#2713 Renamed ShowName to ShowChartOnly, added a backing field and introduced a method to perform the visibility changes of the controls.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Analysis.Views/3.3/DataTableView.cs

    r14982 r15042  
    3636    protected List<Series> invisibleSeries;
    3737    protected Dictionary<IObservableList<double>, DataRow> valuesRowsTable;
     38    protected bool showChartOnly = false;
    3839
    3940    public new DataTable Content {
     
    4243    }
    4344
    44     public bool ShowName {
    45       get { return nameTextBox.Visible; }
     45    public bool ShowChartOnly {
     46      get { return showChartOnly; }
    4647      set {
    47         if (nameTextBox.Visible != value) {
    48           foreach (Control c in Controls) {
    49             if (c == chart) continue;
    50             c.Visible = value;
    51           }
    52           chart.Dock = value ? DockStyle.None : DockStyle.Fill;
     48        if (showChartOnly != value) {
     49          showChartOnly = value;
     50          UpdateControlsVisibility();
    5351        }
    5452      }
     
    133131      } else MessageBox.Show("Nothing to configure.");
    134132    }
     133
     134    protected void UpdateControlsVisibility() {
     135      if (InvokeRequired)
     136        Invoke(new Action(UpdateControlsVisibility));
     137      else {
     138        foreach (Control c in Controls) {
     139          if (c == chart) continue;
     140          c.Visible = !showChartOnly;
     141        }
     142        chart.Dock = showChartOnly ? DockStyle.Fill : DockStyle.None;
     143      }
     144    }
     145
    135146    protected virtual void AddDataRows(IEnumerable<DataRow> rows) {
    136147      foreach (var row in rows) {
Note: See TracChangeset for help on using the changeset viewer.