Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/27/20 15:45:50 (4 years ago)
Author:
mkommend
Message:

#2971: Minor changes in interval collection and interval interpreter.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Views/3.4/IntervalCollectionView.cs

    r17145 r17564  
    2121
    2222
    23 using System.Linq;
    2423using System.Windows.Forms;
    2524using HeuristicLab.MainForm;
     
    6968
    7069
    71       var variablesCount = Content.GetIntervals().Count;
     70      var variablesCount = Content.Count;
    7271
    7372      DataGridViewRow[] rows = new DataGridViewRow[variablesCount];
     
    7877      dataGridView.Rows.AddRange(rows);
    7978
    80       SetRowsHeader();
    81       FillRows();
     79      int j = 0;
     80      foreach (var variableInterval in Content.GetVariableIntervals()) {
     81        dataGridView.Rows[j].HeaderCell.Value = variableInterval.Item1;
     82        dataGridView.Rows[j].Cells[0].Value = variableInterval.Item2.LowerBound;
     83        dataGridView.Rows[j].Cells[1].Value = variableInterval.Item2.UpperBound;
     84        j++;
     85      }
    8286
    8387      dataGridView.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
     
    8791      foreach (DataGridViewColumn column in dataGridView.Columns) {
    8892        column.SortMode = DataGridViewColumnSortMode.NotSortable;
    89       }
    90     }
    91 
    92     private void FillRows() {
    93       for (var i = 0; i < dataGridView.RowCount; ++i) {
    94         var key = (string)dataGridView.Rows[i].HeaderCell.Value;
    95         dataGridView.Rows[i].Cells[0].Value = Content.GetInterval(key).LowerBound;
    96         dataGridView.Rows[i].Cells[1].Value = Content.GetInterval(key).UpperBound;
    97       }
    98     }
    99 
    100     private void SetRowsHeader() {
    101       for (var i = 0; i < Content.GetIntervals().Count; ++i) {
    102         var item = Content.GetIntervals().ElementAt(i);
    103         dataGridView.Rows[i].HeaderCell.Value = item.Key;
    10493      }
    10594    }
Note: See TracChangeset for help on using the changeset viewer.