Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/01/13 09:57:40 (11 years ago)
Author:
mkommend
Message:

#2081: Implemented reviewer comments by gkronber for path values.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Data/3.3/Path Types/PathValue.cs

    r9697 r9833  
    2020#endregion
    2121
    22 
    2322using System.IO;
    2423using HeuristicLab.Common;
     
    2928  [Item("PathValue", "Represents a path.")]
    3029  [StorableClass]
    31   public abstract class PathValue : StringValue {
    32     public override string Value {
    33       get { return base.Value; }
     30  public abstract class PathValue : Item {
     31
     32    [Storable]
     33    private readonly StringValue stringValue = new StringValue();
     34    public StringValue StringValue {
     35      get { return stringValue; }
     36    }
     37
     38    public string Value {
     39      get { return stringValue.Value; }
    3440      set {
    3541        if (value == null) value = string.Empty;
    3642        value = value.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
    37         base.Value = value;
     43        stringValue.Value = value;
    3844      }
    3945    }
     
    4147    [StorableConstructor]
    4248    protected PathValue(bool deserializing) : base(deserializing) { }
    43     protected PathValue(PathValue original, Cloner cloner) : base(original, cloner) { }
     49    protected PathValue(PathValue original, Cloner cloner)
     50      : base(original, cloner) {
     51      stringValue = cloner.Clone(original.stringValue);
     52    }
    4453
    45     protected PathValue()
    46       : base(string.Empty) { }
     54    protected PathValue() : base() { }
    4755
    4856    public abstract bool Exists();
Note: See TracChangeset for help on using the changeset viewer.