Changeset 16692 for branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3
- Timestamp:
- 03/18/19 17:24:30 (6 years ago)
- Location:
- branches/2521_ProblemRefactoring
- Files:
-
- 40 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring
- Property svn:ignore
-
old new 24 24 protoc.exe 25 25 obj 26 .vs
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3
- Property svn:mergeinfo changed
-
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/BoolArray.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 28 28 [Item("BoolArray", "Represents an array of boolean values.")] 29 29 [StorableClass] 30 public class BoolArray : ValueTypeArray<bool>, IStringConvertibleArray{30 public class BoolArray : StringConvertibleArray<bool> { 31 31 [StorableConstructor] 32 32 protected BoolArray(bool deserializing) : base(deserializing) { } … … 42 42 } 43 43 44 protected virtualbool Validate(string value, out string errorMessage) {44 protected override bool Validate(string value, out string errorMessage) { 45 45 bool val; 46 46 bool valid = bool.TryParse(value, out val); … … 55 55 return valid; 56 56 } 57 protected virtualstring GetValue(int index) {57 protected override string GetValue(int index) { 58 58 return this[index].ToString(); 59 59 } 60 protected virtualbool SetValue(string value, int index) {60 protected override bool SetValue(string value, int index) { 61 61 bool val; 62 62 if (bool.TryParse(value, out val)) { … … 67 67 } 68 68 } 69 70 #region IStringConvertibleArray Members71 int IStringConvertibleArray.Length {72 get { return Length; }73 set { Length = value; }74 }75 bool IStringConvertibleArray.Validate(string value, out string errorMessage) {76 return Validate(value, out errorMessage);77 }78 string IStringConvertibleArray.GetValue(int index) {79 return GetValue(index);80 }81 bool IStringConvertibleArray.SetValue(string value, int index) {82 return SetValue(value, index);83 }84 #endregion85 69 } 86 70 } -
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/BoolMatrix.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/BoolValue.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/Comparison.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/ComparisonType.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/DateTimeValue.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/DoubleArray.cs
r12432 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 28 28 [Item("DoubleArray", "Represents an array of double values.")] 29 29 [StorableClass] 30 public class DoubleArray : ValueTypeArray<double>, IStringConvertibleArray{30 public class DoubleArray : StringConvertibleArray<double> { 31 31 [StorableConstructor] 32 32 protected DoubleArray(bool deserializing) : base(deserializing) { } … … 42 42 } 43 43 44 protected virtualbool Validate(string value, out string errorMessage) {44 protected override bool Validate(string value, out string errorMessage) { 45 45 double val; 46 46 bool valid = double.TryParse(value, out val); … … 55 55 return valid; 56 56 } 57 protected virtualstring GetValue(int index) {57 protected override string GetValue(int index) { 58 58 return this[index].ToString("r"); 59 59 } 60 protected virtualbool SetValue(string value, int index) {60 protected override bool SetValue(string value, int index) { 61 61 double val; 62 62 if (double.TryParse(value, out val)) { … … 67 67 } 68 68 } 69 70 #region IStringConvertibleArray Members71 int IStringConvertibleArray.Length {72 get { return Length; }73 set { Length = value; }74 }75 bool IStringConvertibleArray.Validate(string value, out string errorMessage) {76 return Validate(value, out errorMessage);77 }78 string IStringConvertibleArray.GetValue(int index) {79 return GetValue(index);80 }81 bool IStringConvertibleArray.SetValue(string value, int index) {82 return SetValue(value, index);83 }84 #endregion85 69 } 86 70 } -
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/DoubleMatrix.cs
r12432 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/DoubleRange.cs
r12432 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/DoubleValue.cs
r12433 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/EnumValue.cs
r12148 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 52 52 private EnumValue(EnumValue<T> original, Cloner cloner) 53 53 : base(original, cloner) { 54 this.value = original.value;55 this.readOnly = original.readOnly;56 54 } 57 55 -
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/FormatPatterns.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/HeuristicLab.Data-3.3.csproj
r12037 r16692 124 124 <Compile Include="ComparisonType.cs" /> 125 125 <Compile Include="EnumValue.cs" /> 126 <Compile Include="Interfaces\IValueTypeArray.cs" /> 126 127 <Compile Include="Path Types\DirectoryValue.cs" /> 127 128 <Compile Include="Path Types\FileValue.cs" /> … … 148 149 <Compile Include="Properties\AssemblyInfo.cs" /> 149 150 <Compile Include="StringArray.cs" /> 151 <Compile Include="StringConvertibleArray.cs" /> 150 152 <Compile Include="StringMatrix.cs" /> 151 153 <Compile Include="StringValue.cs" /> -
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/IntArray.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 28 28 [Item("IntArray", "Represents an array of integer values.")] 29 29 [StorableClass] 30 public class IntArray : ValueTypeArray<int>, IStringConvertibleArray{30 public class IntArray : StringConvertibleArray<int> { 31 31 [StorableConstructor] 32 32 protected IntArray(bool deserializing) : base(deserializing) { } … … 42 42 } 43 43 44 protected virtualbool Validate(string value, out string errorMessage) {44 protected override bool Validate(string value, out string errorMessage) { 45 45 int val; 46 46 bool valid = int.TryParse(value, out val); … … 55 55 return valid; 56 56 } 57 protected virtualstring GetValue(int index) {57 protected override string GetValue(int index) { 58 58 return this[index].ToString(); 59 59 } 60 protected virtualbool SetValue(string value, int index) {60 protected override bool SetValue(string value, int index) { 61 61 int val; 62 62 if (int.TryParse(value, out val)) { … … 67 67 } 68 68 } 69 70 #region IStringConvertibleArray Members71 int IStringConvertibleArray.Length {72 get { return Length; }73 set { Length = value; }74 }75 bool IStringConvertibleArray.Validate(string value, out string errorMessage) {76 return Validate(value, out errorMessage);77 }78 string IStringConvertibleArray.GetValue(int index) {79 return GetValue(index);80 }81 bool IStringConvertibleArray.SetValue(string value, int index) {82 return SetValue(value, index);83 }84 #endregion85 69 } 86 70 } -
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/IntMatrix.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/IntRange.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/IntValue.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/Interfaces/IStringConvertibleArray.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 20 20 #endregion 21 21 22 using System;23 using System.Collections.Generic;24 22 using HeuristicLab.Common; 25 23 26 24 namespace HeuristicLab.Data { 27 public interface IStringConvertibleArray : IContent { 28 int Length { get; set; } 29 IEnumerable<string> ElementNames { get; set; } 30 31 bool ReadOnly { get; } 32 25 public interface IStringConvertibleArray : IContent, IValueTypeArray { 33 26 bool Validate(string value, out string errorMessage); 34 27 string GetValue(int index); 35 28 bool SetValue(string value, int index); 36 37 event EventHandler ElementNamesChanged;38 event EventHandler<EventArgs<int>> ItemChanged;39 event EventHandler Reset;40 29 } 41 30 } -
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/Interfaces/IStringConvertibleMatrix.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/Interfaces/IStringConvertibleValue.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/Interfaces/IStringConvertibleValueTuple.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/Path Types/DirectoryValue.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/Path Types/FileValue.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/Path Types/PathValue.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/Path Types/TextFileValue.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/PercentArray.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/PercentMatrix.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/PercentValue.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/Plugin.cs.frame
r13321 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 26 26 /// Plugin class for HeuristicLab.Data plugin. 27 27 /// </summary> 28 [Plugin("HeuristicLab.Data", "3.3.1 3.$WCREV$")]28 [Plugin("HeuristicLab.Data", "3.3.15.$WCREV$")] 29 29 [PluginFile("HeuristicLab.Data-3.3.dll", PluginFileType.Assembly)] 30 30 [PluginDependency("HeuristicLab.Common", "3.3")] -
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/Properties/AssemblyInfo.cs.frame
r13321 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 32 32 [assembly: AssemblyCompany("")] 33 33 [assembly: AssemblyProduct("HeuristicLab")] 34 [assembly: AssemblyCopyright("(c) 2002-201 5HEAL")]34 [assembly: AssemblyCopyright("(c) 2002-2018 HEAL")] 35 35 [assembly: AssemblyTrademark("")] 36 36 [assembly: AssemblyCulture("")] … … 54 54 // by using the '*' as shown below: 55 55 [assembly: AssemblyVersion("3.3.0.0")] 56 [assembly: AssemblyFileVersion("3.3.1 3.$WCREV$")]56 [assembly: AssemblyFileVersion("3.3.15.$WCREV$")] -
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/StringArray.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 61 61 public virtual int Length { 62 62 get { return array.Length; } 63 protectedset {63 set { 64 64 if (ReadOnly) throw new NotSupportedException("Length cannot be set. StringArray is read-only."); 65 65 if (value != Length) { … … 72 72 } 73 73 } 74 [Storable] 75 protected bool resizable = true; 76 public bool Resizable { 77 get { return resizable; } 78 set { 79 if (resizable != value) { 80 resizable = value; 81 OnResizableChanged(); 82 } 83 } 84 } 85 74 86 public virtual string this[int index] { 75 87 get { return array[index]; } … … 102 114 this.array = (string[])original.array.Clone(); 103 115 this.readOnly = original.readOnly; 116 this.resizable = original.resizable; 104 117 this.elementNames = new List<string>(original.elementNames); 105 118 } … … 107 120 array = new string[0]; 108 121 readOnly = false; 122 resizable = true; 109 123 elementNames = new List<string>(); 110 124 } … … 114 128 array[i] = string.Empty; 115 129 readOnly = false; 130 resizable = true; 116 131 elementNames = new List<string>(); 117 132 } … … 122 137 array[i] = elements[i] == null ? string.Empty : elements[i]; 123 138 readOnly = false; 139 resizable = true; 124 140 elementNames = new List<string>(); 125 141 } … … 133 149 readOnlyStringArray.readOnly = true; 134 150 return readOnlyStringArray; 151 } 152 IValueTypeArray IValueTypeArray.AsReadOnly() { 153 return AsReadOnly(); 135 154 } 136 155 … … 155 174 return array.Cast<string>().GetEnumerator(); 156 175 } 157 158 176 IEnumerator IEnumerable.GetEnumerator() { 159 177 return GetEnumerator(); … … 181 199 } 182 200 201 public event EventHandler ResizableChanged; 202 protected virtual void OnResizableChanged() { 203 EventHandler handler = ResizableChanged; 204 if (handler != null) 205 handler(this, EventArgs.Empty); 206 } 183 207 public event EventHandler ElementNamesChanged; 184 208 protected virtual void OnElementNamesChanged() { … … 187 211 handler(this, EventArgs.Empty); 188 212 } 189 190 213 public event EventHandler<EventArgs<int>> ItemChanged; 191 214 protected virtual void OnItemChanged(int index) { … … 203 226 204 227 #region IStringConvertibleArray Members 205 int IStringConvertibleArray.Length {206 get { return Length; }207 set { Length = value; }208 }209 228 bool IStringConvertibleArray.Validate(string value, out string errorMessage) { 210 229 return Validate(value, out errorMessage); -
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/StringConvertibleValueTuple.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/StringMatrix.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/StringValue.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/TimeSpanValue.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 21 21 22 22 using System; 23 using System.Globalization; 23 24 using System.Text; 24 25 using HeuristicLab.Common; … … 52 53 protected virtual bool Validate(string value, out string errorMessage) { 53 54 TimeSpan val; 54 bool valid = TimeSpan.TryParse (value, out val);55 bool valid = TimeSpan.TryParseExact(value, "c", CultureInfo.CurrentCulture, out val); 55 56 errorMessage = string.Empty; 56 57 if (!valid) { … … 64 65 } 65 66 protected virtual string GetValue() { 66 return Value.ToString( );67 return Value.ToString("c"); 67 68 } 68 69 protected virtual bool SetValue(string value) { 69 70 TimeSpan val; 70 if (TimeSpan.TryParse (value, out val)) {71 if (TimeSpan.TryParseExact(value, "c", CultureInfo.CurrentCulture, out val)) { 71 72 Value = val; 72 73 return true; … … 74 75 return false; 75 76 } 77 } 78 public override string ToString() { 79 return Value.ToString("c"); 76 80 } 77 81 -
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/ValueTypeArray.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 33 33 [Item("ValueTypeArray", "An abstract base class for representing arrays of value types.")] 34 34 [StorableClass] 35 public abstract class ValueTypeArray<T> : Item, I Enumerable<T> where T : struct {35 public abstract class ValueTypeArray<T> : Item, IValueTypeArray<T> where T : struct { 36 36 private const int maximumToStringLength = 100; 37 37 … … 75 75 #endregion 76 76 } 77 78 [Storable] 79 protected bool resizable = true; 80 public bool Resizable { 81 get { return resizable; } 82 set { 83 if (resizable != value) { 84 resizable = value; 85 OnResizableChanged(); 86 } 87 } 88 } 89 90 77 91 public virtual T this[int index] { 78 92 get { return array[index]; } … … 103 117 this.array = (T[])original.array.Clone(); 104 118 this.readOnly = original.readOnly; 119 this.resizable = original.resizable; 105 120 this.elementNames = new List<string>(original.elementNames); 106 121 } … … 108 123 array = new T[0]; 109 124 readOnly = false; 125 resizable = true; 110 126 elementNames = new List<string>(); 111 127 } … … 113 129 array = new T[length]; 114 130 readOnly = false; 131 resizable = true; 115 132 elementNames = new List<string>(); 116 133 } … … 119 136 array = (T[])elements.Clone(); 120 137 readOnly = false; 138 resizable = true; 121 139 elementNames = new List<string>(); 122 140 } 123 141 124 public virtual ValueTypeArray<T>AsReadOnly() {142 public virtual IValueTypeArray AsReadOnly() { 125 143 ValueTypeArray<T> readOnlyValueTypeArray = (ValueTypeArray<T>)this.Clone(); 126 144 readOnlyValueTypeArray.readOnly = true; 127 145 return readOnlyValueTypeArray; 146 } 147 148 public T[] CloneAsArray() { 149 //mkommend: this works because T must be a value type (struct constraint); 150 return (T[])array.Clone(); 128 151 } 129 152 … … 153 176 } 154 177 178 public event EventHandler ResizableChanged; 179 protected virtual void OnResizableChanged() { 180 EventHandler handler = ResizableChanged; 181 if (handler != null) 182 handler(this, EventArgs.Empty); 183 } 155 184 public event EventHandler ElementNamesChanged; 156 185 protected virtual void OnElementNamesChanged() { -
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/ValueTypeMatrix.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 195 195 } 196 196 197 198 public T[,] CloneAsMatrix() { 199 //mkommend: this works because T must be a value type (struct constraint); 200 return (T[,])matrix.Clone(); 201 } 202 203 public virtual IEnumerable<T> GetRow(int row) { 204 for (var col = 0; col < Columns; col++) { 205 yield return matrix[row, col]; 206 } 207 } 208 209 public virtual IEnumerable<T> GetColumn(int col) { 210 for (var row = 0; row < Rows; row++) { 211 yield return matrix[row, col]; 212 } 213 } 214 197 215 public override string ToString() { 198 216 if (matrix.Length == 0) return "[]"; -
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/ValueTypeValue.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab.
Note: See TracChangeset
for help on using the changeset viewer.