Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/22/10 03:29:02 (15 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/StringData.cs

    r2665 r2669  
    3131  [Item("String", "Represents a string.")]
    3232  [Creatable("Test")]
    33   public sealed class StringData : ReferenceTypeData<string>, IStringConvertibleData {
    34     public StringData() : base() {
    35       Value = string.Empty;
     33  public sealed class StringData : Item, IStringConvertibleData {
     34    [Storable]
     35    private string value;
     36    public string Value {
     37      get { return value; }
     38      set {
     39        if (value != this.value) {
     40          if ((value != null) || (this.value != string.Empty)) {
     41            this.value = value != null ? value : string.Empty;
     42            OnChanged();
     43          }
     44        }
     45      }
    3646    }
    37     public StringData(string value)
    38       : base() {
    39       Value = value;
     47
     48    public StringData() {
     49      this.value = string.Empty;
     50    }
     51    public StringData(string value) {
     52      this.value = value != null ? value : string.Empty;
    4053    }
    4154
     
    4457      cloner.RegisterClonedObject(this, clone);
    4558      return clone;
     59    }
     60
     61    public override string ToString() {
     62      return value;
    4663    }
    4764
Note: See TracChangeset for help on using the changeset viewer.