Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/14/16 14:57:02 (8 years ago)
Author:
mkommend
Message:

#2589: Added resizable option in ValueTypeArray and refactored the array implementations and interfaces.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Data/3.3/BoolArray.cs

    r12012 r13695  
    2828  [Item("BoolArray", "Represents an array of boolean values.")]
    2929  [StorableClass]
    30   public class BoolArray : ValueTypeArray<bool>, IStringConvertibleArray {
     30  public class BoolArray : StringConvertibleArray<bool> {
    3131    [StorableConstructor]
    3232    protected BoolArray(bool deserializing) : base(deserializing) { }
     
    4242    }
    4343
    44     protected virtual bool Validate(string value, out string errorMessage) {
     44    protected override bool Validate(string value, out string errorMessage) {
    4545      bool val;
    4646      bool valid = bool.TryParse(value, out val);
     
    5555      return valid;
    5656    }
    57     protected virtual string GetValue(int index) {
     57    protected override string GetValue(int index) {
    5858      return this[index].ToString();
    5959    }
    60     protected virtual bool SetValue(string value, int index) {
     60    protected override bool SetValue(string value, int index) {
    6161      bool val;
    6262      if (bool.TryParse(value, out val)) {
     
    6767      }
    6868    }
    69 
    70     #region IStringConvertibleArray Members
    71     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     #endregion
    8569  }
    8670}
Note: See TracChangeset for help on using the changeset viewer.