Changeset 3054 for trunk/sources/HeuristicLab.Data/3.3/BoolArray.cs
- Timestamp:
- 03/16/10 04:24:01 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Data/3.3/BoolArray.cs
r3048 r3054 28 28 [Creatable("Test")] 29 29 [StorableClass] 30 public sealedclass BoolArray : ValueTypeArray<bool>, IStringConvertibleArray {30 public class BoolArray : ValueTypeArray<bool>, IStringConvertibleArray { 31 31 public BoolArray() : base() { } 32 32 public BoolArray(int length) : base(length) { } 33 33 public BoolArray(bool[] elements) : base(elements) { } 34 private BoolArray(BoolArray elements) : base(elements) { }35 34 36 35 public override IDeepCloneable Clone(Cloner cloner) { 37 BoolArray clone = new BoolArray( this);36 BoolArray clone = new BoolArray(array); 38 37 cloner.RegisterClonedObject(this, clone); 39 38 return clone; 40 39 } 41 40 42 #region IStringConvertibleArray Members 43 int IStringConvertibleArray.Length { 44 get { return Length; } 45 set { Length = value; } 46 } 47 48 bool IStringConvertibleArray.Validate(string value, out string errorMessage) { 41 protected virtual bool Validate(string value, out string errorMessage) { 49 42 bool val; 50 43 bool valid = bool.TryParse(value, out val); … … 59 52 return valid; 60 53 } 61 string IStringConvertibleArray.GetValue(int index) {54 protected virtual string GetValue(int index) { 62 55 return this[index].ToString(); 63 56 } 64 bool IStringConvertibleArray.SetValue(string value, int index) {57 protected virtual bool SetValue(string value, int index) { 65 58 bool val; 66 59 if (bool.TryParse(value, out val)) { … … 71 64 } 72 65 } 66 67 #region IStringConvertibleArray Members 68 int IStringConvertibleArray.Length { 69 get { return Length; } 70 set { Length = value; } 71 } 72 bool IStringConvertibleArray.Validate(string value, out string errorMessage) { 73 return Validate(value, out errorMessage); 74 } 75 string IStringConvertibleArray.GetValue(int index) { 76 return GetValue(index); 77 } 78 bool IStringConvertibleArray.SetValue(string value, int index) { 79 return SetValue(value, index); 80 } 73 81 #endregion 74 82 }
Note: See TracChangeset
for help on using the changeset viewer.