Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/21/10 05:10:12 (14 years ago)
Author:
swagner
Message:

Continued work on adapting and refactoring HeuristicLab.Data according to the changes in HeuristicLab.Core (#95)

File:
1 edited

Legend:

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

    r2663 r2665  
    2929namespace HeuristicLab.Data {
    3030  [EmptyStorableClass]
    31   [Item("Int Data", "Represents an integer value.")]
     31  [Item("Integer", "Represents an integer value.")]
    3232  [Creatable("Test")]
    33   public sealed class IntData : ValueTypeData<int> {
     33  public sealed class IntData : ValueTypeData<int>, IStringConvertibleData {
    3434    public IntData() : base() { }
    3535    public IntData(int value)
     
    4343      return clone;
    4444    }
     45
     46    string IStringConvertibleData.GetValue() {
     47      return Value.ToString();
     48    }
     49    bool IStringConvertibleData.SetValue(string value) {
     50      int i;
     51      if (int.TryParse(value, out i)) {
     52        Value = i;
     53        return true;
     54      } else {
     55        return false;
     56      }
     57    }
    4558  }
    4659}
Note: See TracChangeset for help on using the changeset viewer.