Changeset 2694 for trunk/sources/HeuristicLab.Data/3.3/IntArrayData.cs
- Timestamp:
- 01/28/10 05:19:03 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Data/3.3/IntArrayData.cs
r2677 r2694 57 57 } 58 58 59 bool IStringConvertibleMatrixData.Validate(string value) { 60 int i; 61 return int.TryParse(value, out i); 59 bool IStringConvertibleMatrixData.Validate(string value, out string errorMessage) { 60 int val; 61 bool valid = int.TryParse(value, out val); 62 errorMessage = string.Empty; 63 if (!valid) { 64 StringBuilder sb = new StringBuilder(); 65 sb.Append("Invalid Value (Valid Value Format: \""); 66 sb.Append(FormatPatterns.GetIntFormatPattern()); 67 sb.Append("\")"); 68 errorMessage = sb.ToString(); 69 } 70 return valid; 62 71 } 63 72 string IStringConvertibleMatrixData.GetValue(int rowIndex, int columIndex) { … … 65 74 } 66 75 bool IStringConvertibleMatrixData.SetValue(string value, int rowIndex, int columnIndex) { 67 int i;68 if (int.TryParse(value, out i)) {69 this[rowIndex] = i;76 int val; 77 if (int.TryParse(value, out val)) { 78 this[rowIndex] = val; 70 79 return true; 71 80 } else {
Note: See TracChangeset
for help on using the changeset viewer.