Changeset 9833 for trunk/sources/HeuristicLab.Data/3.3/Path Types
- Timestamp:
- 08/01/13 09:57:40 (11 years ago)
- Location:
- trunk/sources/HeuristicLab.Data/3.3/Path Types
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Data/3.3/Path Types/DirectoryValue.cs
r9680 r9833 39 39 40 40 public override bool Exists() { 41 return Directory.Exists( value);41 return Directory.Exists(Value); 42 42 } 43 43 } -
trunk/sources/HeuristicLab.Data/3.3/Path Types/FileValue.cs
r9680 r9833 20 20 #endregion 21 21 22 using System;23 22 using System.IO; 24 23 using HeuristicLab.Common; … … 37 36 if (fileDialogFilter != value) { 38 37 fileDialogFilter = value; 39 OnFileOpenDialogFilterChanged();40 38 } 41 39 } … … 58 56 59 57 public override bool Exists() { 60 return File.Exists(value); 61 } 62 63 public event EventHandler FileOpenDialogFilterChanged; 64 protected virtual void OnFileOpenDialogFilterChanged() { 65 var handler = FileOpenDialogFilterChanged; 66 if (handler != null) 67 handler(this, EventArgs.Empty); 58 return File.Exists(Value); 68 59 } 69 60 } -
trunk/sources/HeuristicLab.Data/3.3/Path Types/PathValue.cs
r9697 r9833 20 20 #endregion 21 21 22 23 22 using System.IO; 24 23 using HeuristicLab.Common; … … 29 28 [Item("PathValue", "Represents a path.")] 30 29 [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; } 34 40 set { 35 41 if (value == null) value = string.Empty; 36 42 value = value.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 37 base.Value = value;43 stringValue.Value = value; 38 44 } 39 45 } … … 41 47 [StorableConstructor] 42 48 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 } 44 53 45 protected PathValue() 46 : base(string.Empty) { } 54 protected PathValue() : base() { } 47 55 48 56 public abstract bool Exists();
Note: See TracChangeset
for help on using the changeset viewer.