Changeset 10616
- Timestamp:
- 03/19/14 12:47:42 (11 years ago)
- Location:
- branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/DataGridContent.cs
r10614 r10616 120 120 121 121 public string GetValue(int rowIndex, int columnIndex) { 122 return dataGridLogic.GetValue( rowIndex, columnIndex);122 return dataGridLogic.GetValue(columnIndex, rowIndex); 123 123 } 124 124 125 public bool SetValue(string value, int rowIndex, int columnIndex) {126 return dataGridLogic.SetValue(value, rowIndex, columnIndex);125 public bool SetValue(string value,int columnIndex,int rowIndex, ) { 126 return dataGridLogic.SetValue(value, columnIndex, rowIndex); 127 127 } 128 128 -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/DataGridLogic.cs
r10586 r10616 91 91 } 92 92 93 public string GetValue(int rowIndex, int columnIndex) {93 public string GetValue(int columnIndex, int rowIndex) { 94 94 return preprocessingData.GetCellAsString(columnIndex, rowIndex); 95 95 } 96 96 97 public bool SetValue(string value, int rowIndex, int columnIndex) {97 public bool SetValue(string value, int columnIndex, int rowIndex) { 98 98 bool valid = false; 99 99 if (preprocessingData.IsType<double>(columnIndex)) { 100 100 double val; 101 101 valid = double.TryParse(value, out val); 102 if (valid) { 103 preprocessingData.SetCell<double>(columnIndex, rowIndex, val); 104 } 102 SetValueIfValid(columnIndex, rowIndex, valid, value); 105 103 } else if (preprocessingData.IsType<string>(columnIndex)) { 106 104 valid = value != null; 107 if (valid) { 108 preprocessingData.SetCell<string>(columnIndex, rowIndex, value); 109 } 105 SetValueIfValid(columnIndex, rowIndex, valid, value); 110 106 } else if (preprocessingData.IsType<DateTime>(columnIndex)) { 111 107 DateTime date; 112 108 valid = DateTime.TryParse(value, out date); 113 if (valid) { 114 preprocessingData.SetCell<DateTime>(columnIndex, rowIndex, date); 115 } 109 SetValueIfValid(columnIndex, rowIndex, valid, value); 116 110 } else { 117 111 throw new ArgumentException("column " + columnIndex + " contains a non supported type."); 118 112 } 113 return valid; 114 } 119 115 120 return valid; 116 private void SetValueIfValid<T>(int columnIndex, int rowIndex, bool valid, T value) { 117 if (valid) { 118 preprocessingData.SetCell<T>(columnIndex, rowIndex, value); 119 } 121 120 } 122 121 -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IDataGridLogic.cs
r10571 r10616 29 29 int Rows { get; } 30 30 31 string GetValue(int rowIndex, int columnIndex);32 bool SetValue(string value, int rowIndex, int columnIndex);31 string GetValue(int columnIndex, int rowIndex); 32 bool SetValue(string value, int columnIndex, int rowIndex); 33 33 bool Validate(string value, out string errorMessage, int columnIndex); 34 34
Note: See TracChangeset
for help on using the changeset viewer.