- Timestamp:
- 10/06/15 16:41:59 (9 years ago)
- Location:
- trunk/sources
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixView.cs
r12676 r12983 383 383 ClearSorting(); 384 384 } 385 pr ivatestring[,] SplitClipboardString(string clipboardText) {385 protected string[,] SplitClipboardString(string clipboardText) { 386 386 if (clipboardText.EndsWith(Environment.NewLine)) 387 387 clipboardText = clipboardText.Remove(clipboardText.Length - Environment.NewLine.Length); //remove last newline constant -
trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/DataGridContentView.cs
r12676 r12983 142 142 143 143 144 //protected override void PasteValuesToDataGridView() { 145 // base.PasteValuesToDataGridView(); 146 // dataGridView.Refresh(); 147 //} 144 protected override void PasteValuesToDataGridView() { 145 string[,] values = SplitClipboardString(Clipboard.GetText()); 146 int rowIndex = 0; 147 int columnIndex = 0; 148 if (dataGridView.CurrentCell != null) { 149 rowIndex = dataGridView.CurrentCell.RowIndex; 150 columnIndex = dataGridView.CurrentCell.ColumnIndex; 151 } 152 if (Content.Rows < values.GetLength(1) + rowIndex) Content.Rows = values.GetLength(1) + rowIndex; 153 if (Content.Columns < values.GetLength(0) + columnIndex) Content.Columns = values.GetLength(0) + columnIndex; 154 155 ReplaceTransaction(() => { 156 Content.PreProcessingData.InTransaction(() => { 157 for (int row = 0; row < values.GetLength(1); row++) { 158 for (int col = 0; col < values.GetLength(0); col++) { 159 Content.SetValue(values[col, row], row + rowIndex, col + columnIndex); 160 } 161 } 162 }); 163 }); 164 165 ClearSorting(); 166 //UpdateData(); // rownames are created on DataGrid creation. Therefore, no update possible, yet. 167 } 148 168 149 169 protected override void SetEnabledStateOfControls() { -
trunk/sources/HeuristicLab.DataPreprocessing/3.4/Implementations/DataGridContent.cs
r12676 r12983 75 75 } 76 76 set { 77 //not supported77 throw new NotSupportedException(); 78 78 } 79 79 } … … 84 84 } 85 85 set { 86 //not supported86 throw new NotSupportedException(); 87 87 } 88 88 } -
trunk/sources/HeuristicLab.DataPreprocessing/3.4/Implementations/TransactionalPreprocessingData.cs
r12012 r12983 98 98 public override void SetCell<T>(int columnIndex, int rowIndex, T value) { 99 99 SaveSnapshot(DataPreprocessingChangedEventType.ChangeItem, columnIndex, rowIndex); 100 101 for (int i = Rows; i <= rowIndex; i++) 102 InsertRow(i); 103 for (int i = Columns; i <= columnIndex; i++) 104 InsertColumn<T>(i.ToString(), i); 105 100 106 variableValues[columnIndex][rowIndex] = value; 101 107 if (!IsInTransaction) … … 116 122 117 123 public override bool VariableHasType<T>(int columnIndex) { 118 return variableValues[columnIndex] is List<T>;124 return columnIndex >= variableValues.Count || variableValues[columnIndex] is List<T>; 119 125 } 120 126 … … 242 248 public override void InsertColumn<T>(string variableName, int columnIndex) { 243 249 SaveSnapshot(DataPreprocessingChangedEventType.DeleteColumn, columnIndex, -1); 244 variableValues.Insert(columnIndex, new List<T>( Rows));250 variableValues.Insert(columnIndex, new List<T>(Enumerable.Repeat(default(T), Rows))); 245 251 variableNames.Insert(columnIndex, variableName); 246 252 if (!IsInTransaction) -
trunk/sources/HeuristicLab.DataPreprocessing/3.4/ProblemDataCreator.cs
r12676 r12983 63 63 var inputVariables = oldProblemData.InputVariables.ToDictionary(x => x.Value, x => x); 64 64 foreach (var variable in problemData.InputVariables) { 65 bool isChecked = oldProblemData.InputVariables. ItemChecked(inputVariables[variable.Value]);65 bool isChecked = oldProblemData.InputVariables.Contains(variable) && oldProblemData.InputVariables.ItemChecked(inputVariables[variable.Value]); 66 66 problemData.InputVariables.SetItemCheckedState(variable, isChecked); 67 67 }
Note: See TracChangeset
for help on using the changeset viewer.