Changeset 3308 for trunk/sources/HeuristicLab.Data
- Timestamp:
- 04/12/10 14:14:39 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Data/3.3
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Data/3.3/BoolMatrix.cs
r3160 r3308 20 20 #endregion 21 21 22 using System.Collections.Generic; 22 23 using System.Text; 23 24 using HeuristicLab.Core; … … 73 74 set { Columns = value; } 74 75 } 76 IEnumerable<string> IStringConvertibleMatrix.ColumnNames { 77 get { return this.ColumnNames; } 78 set { this.ColumnNames = value; } 79 } 75 80 bool IStringConvertibleMatrix.Validate(string value, out string errorMessage) { 76 81 return Validate(value, out errorMessage); -
trunk/sources/HeuristicLab.Data/3.3/DoubleMatrix.cs
r3160 r3308 20 20 #endregion 21 21 22 using System.Collections.Generic; 22 23 using System.Text; 23 24 using HeuristicLab.Core; … … 73 74 set { Columns = value; } 74 75 } 76 IEnumerable<string> IStringConvertibleMatrix.ColumnNames { 77 get { return this.ColumnNames; } 78 set { this.ColumnNames = value; } 79 } 75 80 bool IStringConvertibleMatrix.Validate(string value, out string errorMessage) { 76 81 return Validate(value, out errorMessage); -
trunk/sources/HeuristicLab.Data/3.3/IStringConvertibleMatrix.cs
r3048 r3308 22 22 using System; 23 23 using HeuristicLab.Common; 24 using System.Collections.Generic; 24 25 25 26 namespace HeuristicLab.Data { … … 27 28 int Rows { get; set; } 28 29 int Columns { get; set; } 30 31 IEnumerable<string> ColumnNames { get; set; } 32 //bool SortableView { get; } 29 33 30 34 bool Validate(string value, out string errorMessage); -
trunk/sources/HeuristicLab.Data/3.3/IntMatrix.cs
r3160 r3308 20 20 #endregion 21 21 22 using System.Collections.Generic; 22 23 using System.Text; 23 24 using HeuristicLab.Core; … … 73 74 set { Columns = value; } 74 75 } 76 IEnumerable<string> IStringConvertibleMatrix.ColumnNames { 77 get { return this.ColumnNames; } 78 set { this.ColumnNames = value; } 79 } 75 80 bool IStringConvertibleMatrix.Validate(string value, out string errorMessage) { 76 81 return Validate(value, out errorMessage); -
trunk/sources/HeuristicLab.Data/3.3/StringMatrix.cs
r3306 r3308 22 22 using System; 23 23 using System.Collections; 24 using System.Collections.Generic; 24 25 using System.Drawing; 26 using System.Linq; 25 27 using System.Text; 26 28 using HeuristicLab.Common; … … 38 40 [Storable] 39 41 protected string[,] matrix; 42 43 [Storable] 44 protected List<string> columnNames; 45 public IEnumerable<string> ColumnNames { 46 get { return this.columnNames; } 47 set { 48 if (value == null || value.Count() == 0) 49 columnNames = new List<string>(); 50 else if (value.Count() != Columns) 51 throw new ArgumentException("A columnName must be for each column specified."); 52 else 53 columnNames = new List<string>(value); 54 } 55 } 40 56 41 57 public virtual int Rows { … … 76 92 public StringMatrix() { 77 93 matrix = new string[0, 0]; 94 columnNames = new List<string>(); 78 95 } 79 96 public StringMatrix(int rows, int columns) { … … 83 100 matrix[i, j] = string.Empty; 84 101 } 102 columnNames = new List<string>(); 103 } 104 protected StringMatrix(int rows, int columns, IEnumerable<string> columnNames) 105 : this(rows, columns) { 106 ColumnNames = columnNames; 85 107 } 86 108 public StringMatrix(string[,] elements) { … … 91 113 matrix[i, j] = elements[i, j] == null ? string.Empty : elements[i, j]; 92 114 } 115 columnNames = new List<string>(); 116 } 117 protected StringMatrix(string[,] elements, IEnumerable<string> columnNames) 118 : this(elements) { 119 ColumnNames = columnNames; 93 120 } 94 121 … … 162 189 set { Columns = value; } 163 190 } 191 IEnumerable<string> IStringConvertibleMatrix.ColumnNames { 192 get { return this.ColumnNames; } 193 set { this.ColumnNames = value; } 194 } 164 195 bool IStringConvertibleMatrix.Validate(string value, out string errorMessage) { 165 196 return Validate(value, out errorMessage); -
trunk/sources/HeuristicLab.Data/3.3/ValueTypeMatrix.cs
r3306 r3308 22 22 using System; 23 23 using System.Collections; 24 using System.Collections.Generic; 24 25 using System.Drawing; 26 using System.Linq; 25 27 using System.Text; 26 28 using HeuristicLab.Common; … … 38 40 [Storable] 39 41 protected T[,] matrix; 42 43 [Storable] 44 protected List<string> columnNames; 45 public IEnumerable<string> ColumnNames { 46 get { return this.columnNames; } 47 set { 48 if (value == null || value.Count() == 0) 49 columnNames = new List<string>(); 50 else if (value.Count() != Columns) 51 throw new ArgumentException("A columnName must be for each column specified."); 52 else 53 columnNames = new List<string>(value); 54 } 55 } 40 56 41 57 public virtual int Rows { … … 74 90 protected ValueTypeMatrix() { 75 91 matrix = new T[0, 0]; 92 columnNames = new List<string>(); 76 93 } 77 94 protected ValueTypeMatrix(int rows, int columns) { 78 95 matrix = new T[rows, columns]; 96 columnNames = new List<string>(); 97 } 98 protected ValueTypeMatrix(int rows, int columns, IEnumerable<string> columnNames) 99 : this(rows, columns) { 100 ColumnNames = columnNames; 79 101 } 80 102 protected ValueTypeMatrix(T[,] elements) { 81 103 if (elements == null) throw new ArgumentNullException(); 82 104 matrix = (T[,])elements.Clone(); 105 columnNames = new List<string>(); 106 } 107 protected ValueTypeMatrix(T[,] elements, IEnumerable<string> columnNames) 108 : this(elements) { 109 ColumnNames = columnNames; 83 110 } 84 111
Note: See TracChangeset
for help on using the changeset viewer.