Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/28/10 05:19:03 (14 years ago)
Author:
swagner
Message:

Operator architecture refactoring (#95)

  • finished implemented ideas which came up during yesterday's presentation of HeuristicLab.Core and related plugins
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Data/3.3/IntArrayData.cs

    r2677 r2694  
    5757    }
    5858
    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;
    6271    }
    6372    string IStringConvertibleMatrixData.GetValue(int rowIndex, int columIndex) {
     
    6574    }
    6675    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;
    7079        return true;
    7180      } else {
Note: See TracChangeset for help on using the changeset viewer.