Changeset 10146
- Timestamp:
- 11/20/13 14:29:19 (11 years ago)
- Location:
- branches/DataPreprocessing
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/HeuristicLab.DataPreprocessing-3.3.csproj
r10144 r10146 84 84 <DependentUpon>DataPreprocessingView.cs</DependentUpon> 85 85 </Compile> 86 <Compile Include="EditableDataset.cs" /> 86 87 <Compile Include="Plugin.cs" /> 87 88 <Compile Include="Properties\AssemblyInfo.cs" /> -
branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis/3.4/Dataset.cs
r10145 r10146 35 35 public class Dataset : NamedItem, IDataset { 36 36 [StorableConstructor] 37 pr ivateDataset(bool deserializing) : base(deserializing) { }38 pr ivateDataset(Dataset original, Cloner cloner)37 protected Dataset(bool deserializing) : base(deserializing) { } 38 protected Dataset(Dataset original, Cloner cloner) 39 39 : base(original, cloner) { 40 40 variableValues = new Dictionary<string, IList>(original.variableValues); … … 143 143 144 144 [Storable(Name = "VariableValues")] 145 pr ivateDictionary<string, IList> variableValues;146 147 pr ivateList<string> variableNames;145 protected Dictionary<string, IList> variableValues; 146 147 protected List<string> variableNames; 148 148 [Storable] 149 149 public IEnumerable<string> VariableNames { … … 212 212 set { throw new NotSupportedException(); } 213 213 } 214 public bool ReadOnly {214 public virtual bool ReadOnly { 215 215 get { return false; } 216 216 } … … 228 228 return variableValues[variableNames[columnIndex]][rowIndex].ToString(); 229 229 } 230 public bool SetValue(string value, int rowIndex, int columnIndex) { 231 var values = variableValues[variableNames[columnIndex]]; 232 object insertValue = null; 233 if (values is List<double>) 234 insertValue = Double.Parse(value); /// TODO: set culture 235 else if (values is List<string>) 236 insertValue = value; 237 else if (values is List<DateTime>) 238 insertValue = DateTime.Parse(value); 239 else 240 throw new ArgumentException("The variable values must be of type double, string or DateTime"); 241 242 variableValues[variableNames[columnIndex]][rowIndex] = insertValue; 243 return true; 230 public virtual bool SetValue(string value, int rowIndex, int columnIndex) { 231 throw new NotSupportedException(); 244 232 } 245 233 public bool Validate(string value, out string errorMessage) {
Note: See TracChangeset
for help on using the changeset viewer.