Changeset 14270
- Timestamp:
- 08/31/16 16:15:35 (8 years ago)
- Location:
- trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4
- Property svn:ignore
-
old new 1 1 ComparisonFilterView.resx 2 2 FilterView.resx 3 *.user
-
- Property svn:ignore
-
trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingChartView.cs
r14185 r14270 59 59 //Add or remove data row 60 60 private void CheckedItemsChanged(object sender, CollectionItemsChangedEventArgs<IndexedItem<StringValue>> checkedItems) { 61 61 tableLayoutPanel.SuspendLayout(); 62 62 foreach (IndexedItem<StringValue> item in checkedItems.Items) { 63 63 string variableName = item.Value.Value; 64 64 65 // variable is displayed -> remove66 if ( VariableIsDisplayed(variableName)) {67 dataTable .Rows.Remove(variableName);65 // not checked -> remove 66 if (!VariableIsChecked(variableName)) { 67 dataTableView.SetRowEnabled(variableName, false); 68 68 dataTable.SelectedRows.Remove(variableName); 69 69 dataTablePerVariable.Remove(dataTablePerVariable.Find(x => (x.Name == variableName))); 70 //variable isnt't displayed -> add71 70 } else { 72 71 DataRow row = GetDataRow(variableName); 73 72 DataRow selectedRow = GetSelectedDataRow(variableName); 74 dataTable .Rows.Add(row);73 dataTableView.SetRowEnabled(variableName, true); 75 74 76 75 PreprocessingDataTable pdt = new PreprocessingDataTable(variableName); 77 76 pdt.Rows.Add(row); 78 dataTablePerVariable.Add(pdt); 77 // dataTablePerVariable does not contain unchecked variables => reduce insert position by number of uncheckt variables to correct the index 78 int uncheckedUntilVariable = checkedItemList.Content.TakeWhile(x => x.Value != variableName).Count(x => !checkedItemList.Content.ItemChecked(x)); 79 dataTablePerVariable.Insert(item.Index - uncheckedUntilVariable, pdt); 79 80 80 81 //update selection … … 89 90 if (Content != null && !Content.AllInOneMode) 90 91 GenerateChart(); 91 92 } 93 94 private bool VariableIsDisplayed(string name) { 95 96 foreach (var item in dataTable.Rows) { 97 if (item.Name == name) 98 return true; 99 } 100 return false; 92 tableLayoutPanel.ResumeLayout(true); 93 } 94 95 private bool VariableIsChecked(string name) { 96 return Content.VariableItemList.CheckedItems.Any(x => x.Value.Value == name); 101 97 } 102 98 … … 158 154 dataTable.SelectedRows.Clear(); 159 155 foreach (var selectedRow in selectedDataRows) { 160 if (VariableIs Displayed(selectedRow.Name))156 if (VariableIsChecked(selectedRow.Name)) 161 157 dataTable.SelectedRows.Add(selectedRow); 162 158 } -
trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingDataTableView.cs
r14185 r14270 139 139 } 140 140 } else MessageBox.Show("Nothing to configure."); 141 } 142 143 public bool IsRowEnabled(string name) { 144 return chart.Series.FindByName(name) != null && chart.Series[name].Enabled; 145 } 146 public void SetRowEnabled(string name, bool enabled) { 147 if (chart.Series.FindByName(name) != null) 148 chart.Series[name].Enabled = enabled; 141 149 } 142 150
Note: See TracChangeset
for help on using the changeset viewer.