Changeset 3048 for trunk/sources/HeuristicLab.Data/3.3/StringMatrix.cs
- Timestamp:
- 03/15/10 23:49:54 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Data/3.3/StringMatrix.cs
r3047 r3048 28 28 29 29 namespace HeuristicLab.Data { 30 [Item("StringMatrix Data", "Represents a matrix of strings.")]30 [Item("StringMatrix", "Represents a matrix of strings.")] 31 31 [Creatable("Test")] 32 32 [StorableClass] 33 public sealed class StringMatrix Data : Item, IEnumerable, IStringConvertibleMatrixData{33 public sealed class StringMatrix : Item, IEnumerable, IStringConvertibleMatrix { 34 34 [Storable] 35 35 private string[,] array; … … 70 70 } 71 71 72 public StringMatrix Data() {72 public StringMatrix() { 73 73 array = new string[0, 0]; 74 74 } 75 public StringMatrix Data(int rows, int columns) {75 public StringMatrix(int rows, int columns) { 76 76 array = new string[rows, columns]; 77 77 for (int i = 0; i < array.GetLength(0); i++) { … … 80 80 } 81 81 } 82 public StringMatrix Data(string[,] elements) {82 public StringMatrix(string[,] elements) { 83 83 if (elements == null) throw new ArgumentNullException(); 84 84 array = new string[elements.GetLength(0), elements.GetLength(1)]; … … 88 88 } 89 89 } 90 private StringMatrix Data(StringMatrixDataelements) {90 private StringMatrix(StringMatrix elements) { 91 91 if (elements == null) throw new ArgumentNullException(); 92 92 array = (string[,])elements.array.Clone(); … … 94 94 95 95 public override IDeepCloneable Clone(Cloner cloner) { 96 StringMatrix Data clone = new StringMatrixData(this);96 StringMatrix clone = new StringMatrix(this); 97 97 cloner.RegisterClonedObject(this, clone); 98 98 return clone; … … 118 118 } 119 119 120 #region IStringConvertibleMatrix DataMembers121 int IStringConvertibleMatrix Data.Rows {120 #region IStringConvertibleMatrix Members 121 int IStringConvertibleMatrix.Rows { 122 122 get { return Rows; } 123 123 set { Rows = value; } 124 124 } 125 int IStringConvertibleMatrix Data.Columns {125 int IStringConvertibleMatrix.Columns { 126 126 get { return Columns; } 127 127 set { Columns = value; } 128 128 } 129 129 130 bool IStringConvertibleMatrix Data.Validate(string value, out string errorMessage) {130 bool IStringConvertibleMatrix.Validate(string value, out string errorMessage) { 131 131 if (value == null) { 132 132 errorMessage = "Invalid Value (string must not be null)"; … … 137 137 } 138 138 } 139 string IStringConvertibleMatrix Data.GetValue(int rowIndex, int columIndex) {139 string IStringConvertibleMatrix.GetValue(int rowIndex, int columIndex) { 140 140 return this[rowIndex, columIndex]; 141 141 } 142 bool IStringConvertibleMatrix Data.SetValue(string value, int rowIndex, int columnIndex) {142 bool IStringConvertibleMatrix.SetValue(string value, int rowIndex, int columnIndex) { 143 143 if (value != null) { 144 144 this[rowIndex, columnIndex] = value;
Note: See TracChangeset
for help on using the changeset viewer.