Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/16/19 16:12:21 (5 years ago)
Author:
abeham
Message:

#2521: worked on refactoring PTSP

Location:
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/BoolArray.cs

    r17226 r17253  
    2121
    2222using System.Text;
     23using HEAL.Attic;
    2324using HeuristicLab.Common;
    2425using HeuristicLab.Core;
    25 using HEAL.Attic;
    2626
    2727namespace HeuristicLab.Data {
     
    3636    public BoolArray() : base() { }
    3737    public BoolArray(int length) : base(length) { }
    38     public BoolArray(bool[] elements) : base(elements) { }
     38    public BoolArray(bool[] elements, bool @readonly = false) : base(elements, @readonly) { }
    3939
    4040    public override IDeepCloneable Clone(Cloner cloner) {
     
    6767      }
    6868    }
     69
     70    public new BoolArray AsReadOnly() {
     71      return (BoolArray)base.AsReadOnly();
     72    }
    6973  }
    7074}
  • branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/BoolMatrix.cs

    r17226 r17253  
    2222using System.Collections.Generic;
    2323using System.Text;
     24using HEAL.Attic;
    2425using HeuristicLab.Common;
    2526using HeuristicLab.Core;
    26 using HEAL.Attic;
    2727
    2828namespace HeuristicLab.Data {
     
    3939    public BoolMatrix(int rows, int columns, IEnumerable<string> columnNames) : base(rows, columns, columnNames) { }
    4040    public BoolMatrix(int rows, int columns, IEnumerable<string> columnNames, IEnumerable<string> rowNames) : base(rows, columns, columnNames, rowNames) { }
    41     public BoolMatrix(bool[,] elements) : base(elements) { }
    42     public BoolMatrix(bool[,] elements, IEnumerable<string> columnNames) : base(elements, columnNames) { }
    43     public BoolMatrix(bool[,] elements, IEnumerable<string> columnNames, IEnumerable<string> rowNames) : base(elements, columnNames, rowNames) { }
     41    public BoolMatrix(bool[,] elements, bool @readonly = false) : base(elements, @readonly) { }
     42    public BoolMatrix(bool[,] elements, IEnumerable<string> columnNames, bool @readonly = false) : base(elements, columnNames, @readonly) { }
     43    public BoolMatrix(bool[,] elements, IEnumerable<string> columnNames, IEnumerable<string> rowNames, bool @readonly = false) : base(elements, columnNames, rowNames, @readonly) { }
    4444
    4545    public override IDeepCloneable Clone(Cloner cloner) {
     
    7373    }
    7474
     75    public new BoolMatrix AsReadOnly() {
     76      return (BoolMatrix)base.AsReadOnly();
     77    }
     78
    7579    #region IStringConvertibleMatrix Members
    7680    int IStringConvertibleMatrix.Rows {
  • branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/BoolValue.cs

    r17226 r17253  
    2323using System.Drawing;
    2424using System.Text;
     25using HEAL.Attic;
    2526using HeuristicLab.Common;
    2627using HeuristicLab.Core;
    27 using HEAL.Attic;
    2828
    2929namespace HeuristicLab.Data {
     
    4141    }
    4242    public BoolValue() : base() { }
    43     public BoolValue(bool value) : base(value) { }
     43    public BoolValue(bool value, bool @readonly = false) : base(value, @readonly) { }
    4444
    4545    public override IDeepCloneable Clone(Cloner cloner) {
     
    8181    }
    8282
     83    public new BoolValue AsReadOnly() {
     84      return (BoolValue)base.AsReadOnly();
     85    }
     86
    8387    #region IStringConvertibleValue Members
    8488    bool IStringConvertibleValue.Validate(string value, out string errorMessage) {
  • branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/DoubleArray.cs

    r17226 r17253  
    2121
    2222using System.Text;
     23using HEAL.Attic;
    2324using HeuristicLab.Common;
    2425using HeuristicLab.Core;
    25 using HEAL.Attic;
    2626
    2727namespace HeuristicLab.Data {
     
    3636    public DoubleArray() : base() { }
    3737    public DoubleArray(int length) : base(length) { }
    38     public DoubleArray(double[] elements) : base(elements) { }
     38    public DoubleArray(double[] elements, bool @readonly = false) : base(elements, @readonly) { }
    3939
    4040    public override IDeepCloneable Clone(Cloner cloner) {
     
    6767      }
    6868    }
     69
     70    public new DoubleArray AsReadOnly() {
     71      return (DoubleArray)base.AsReadOnly();
     72    }
    6973  }
    7074}
  • branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/DoubleMatrix.cs

    r17248 r17253  
    7373    }
    7474
     75    public new DoubleMatrix AsReadOnly() {
     76      return (DoubleMatrix)base.AsReadOnly();
     77    }
     78
    7579    #region IStringConvertibleMatrix Members
    7680    int IStringConvertibleMatrix.Rows {
  • branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/DoubleValue.cs

    r17226 r17253  
    2323using System.Drawing;
    2424using System.Text;
     25using HEAL.Attic;
    2526using HeuristicLab.Common;
    2627using HeuristicLab.Core;
    27 using HEAL.Attic;
    2828
    2929namespace HeuristicLab.Data {
     
    4141    }
    4242    public DoubleValue() : base() { }
    43     public DoubleValue(double value) : base(value) { }
     43    public DoubleValue(double value, bool @readonly = false) : base(value, @readonly) { }
    4444
    4545    public override IDeepCloneable Clone(Cloner cloner) {
     
    8585    }
    8686
     87    public new DoubleValue AsReadOnly() {
     88      return (DoubleValue)base.AsReadOnly();
     89    }
     90
    8791    #region IStringConvertibleValue Members
    8892    bool IStringConvertibleValue.Validate(string value, out string errorMessage) {
  • branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/EnumValue.cs

    r17226 r17253  
    2222using System;
    2323using System.Drawing;
     24using HEAL.Attic;
    2425using HeuristicLab.Common;
    2526using HeuristicLab.Core;
    26 using HEAL.Attic;
    2727
    2828namespace HeuristicLab.Data {
     
    3939    }
    4040
    41     public EnumValue() {
    42       this.value = default(T);
    43       this.readOnly = false;
    44     }
    45     public EnumValue(T value) {
    46       this.value = value;
    47       this.readOnly = false;
    48     }
     41    public EnumValue() : base(default(T)) { }
     42    public EnumValue(T value, bool @readonly = false) : base(value, @readonly) { }
    4943
    5044    [StorableConstructor]
     
    6155      return Value.CompareTo(other.Value);
    6256    }
     57
     58    public new EnumValue<T> AsReadOnly() {
     59      return (EnumValue<T>)base.AsReadOnly();
     60    }
    6361  }
    6462}
  • branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/IntArray.cs

    r17226 r17253  
    2121
    2222using System.Text;
     23using HEAL.Attic;
    2324using HeuristicLab.Common;
    2425using HeuristicLab.Core;
    25 using HEAL.Attic;
    2626
    2727namespace HeuristicLab.Data {
     
    3636    public IntArray() : base() { }
    3737    public IntArray(int length) : base(length) { }
    38     public IntArray(int[] elements) : base(elements) { }
     38    public IntArray(int[] elements, bool @readonly = false) : base(elements, @readonly) { }
    3939
    4040    public override IDeepCloneable Clone(Cloner cloner) {
     
    6767      }
    6868    }
     69
     70    public new IntArray AsReadOnly() {
     71      return (IntArray)base.AsReadOnly();
     72    }
    6973  }
    7074}
  • branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/IntMatrix.cs

    r17226 r17253  
    2222using System.Collections.Generic;
    2323using System.Text;
     24using HEAL.Attic;
    2425using HeuristicLab.Common;
    2526using HeuristicLab.Core;
    26 using HEAL.Attic;
    2727
    2828namespace HeuristicLab.Data {
     
    3939    public IntMatrix(int rows, int columns, IEnumerable<string> columnNames) : base(rows, columns, columnNames) { }
    4040    public IntMatrix(int rows, int columns, IEnumerable<string> columnNames,IEnumerable<string> rowNames) : base(rows, columns, columnNames,rowNames) { }
    41     public IntMatrix(int[,] elements) : base(elements) { }
    42     public IntMatrix(int[,] elements, IEnumerable<string> columnNames) : base(elements,columnNames) { }
    43     public IntMatrix(int[,] elements, IEnumerable<string> columnNames, IEnumerable<string> rowNames) : base(elements,columnNames,rowNames) { }
     41    public IntMatrix(int[,] elements, bool @readonly = false) : base(elements, @readonly) { }
     42    public IntMatrix(int[,] elements, IEnumerable<string> columnNames, bool @readonly = false) : base(elements, columnNames, @readonly) { }
     43    public IntMatrix(int[,] elements, IEnumerable<string> columnNames, IEnumerable<string> rowNames, bool @readonly = false) : base(elements, columnNames, rowNames, @readonly) { }
    4444
    4545    public override IDeepCloneable Clone(Cloner cloner) {
     
    7373    }
    7474
     75    public new IntMatrix AsReadOnly() {
     76      return (IntMatrix)base.AsReadOnly();
     77    }
     78
    7579    #region IStringConvertibleMatrix Members
    7680    int IStringConvertibleMatrix.Rows {
  • branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/IntValue.cs

    r17226 r17253  
    2323using System.Drawing;
    2424using System.Text;
     25using HEAL.Attic;
    2526using HeuristicLab.Common;
    2627using HeuristicLab.Core;
    27 using HEAL.Attic;
    2828
    2929namespace HeuristicLab.Data {
     
    4141    }
    4242    public IntValue() : base() { }
    43     public IntValue(int value) : base(value) { }
     43    public IntValue(int value, bool @readonly = false) : base(value, @readonly) { }
    4444
    4545    public override IDeepCloneable Clone(Cloner cloner) {
     
    8181    }
    8282
     83    public new IntValue AsReadOnly() {
     84      return (IntValue)base.AsReadOnly();
     85    }
     86
    8387    #region IStringConvertibleValue Members
    8488    bool IStringConvertibleValue.Validate(string value, out string errorMessage) {
  • branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/PercentArray.cs

    r17226 r17253  
    2121
    2222using System.Text;
     23using HEAL.Attic;
    2324using HeuristicLab.Common;
    2425using HeuristicLab.Core;
    25 using HEAL.Attic;
    2626
    2727namespace HeuristicLab.Data {
     
    3636    public PercentArray() : base() { }
    3737    public PercentArray(int length) : base(length) { }
    38     public PercentArray(double[] elements) : base(elements) { }
     38    public PercentArray(double[] elements, bool @readonly = false) : base(elements, @readonly) { }
    3939
    4040    public override IDeepCloneable Clone(Cloner cloner) {
     
    7777      }
    7878    }
     79
     80    public new PercentArray AsReadOnly() {
     81      return (PercentArray)base.AsReadOnly();
     82    }
    7983  }
    8084}
  • branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/PercentMatrix.cs

    r17226 r17253  
    2222using System.Collections.Generic;
    2323using System.Text;
     24using HEAL.Attic;
    2425using HeuristicLab.Common;
    2526using HeuristicLab.Core;
    26 using HEAL.Attic;
    2727
    2828namespace HeuristicLab.Data {
     
    3939    public PercentMatrix(int rows, int columns, IEnumerable<string> columnNames) : base(rows, columns, columnNames) { }
    4040    public PercentMatrix(int rows, int columns, IEnumerable<string> columnNames, IEnumerable<string> rowNames) : base(rows, columns, columnNames, rowNames) { }
    41     public PercentMatrix(double[,] elements) : base(elements) { }
    42     public PercentMatrix(double[,] elements, IEnumerable<string> columnNames) : base(elements, columnNames) { }
    43     public PercentMatrix(double[,] elements, IEnumerable<string> columnNames, IEnumerable<string> rowNames) : base(elements, columnNames, rowNames) { }
     41    public PercentMatrix(double[,] elements, bool @readonly = false) : base(elements, @readonly) { }
     42    public PercentMatrix(double[,] elements, IEnumerable<string> columnNames, bool @readonly = false) : base(elements, columnNames, @readonly) { }
     43    public PercentMatrix(double[,] elements, IEnumerable<string> columnNames, IEnumerable<string> rowNames, bool @readonly = false) : base(elements, columnNames, rowNames, @readonly) { }
    4444
    4545    public override IDeepCloneable Clone(Cloner cloner) {
     
    8585      }
    8686    }
     87
     88    public new PercentMatrix AsReadOnly() {
     89      return (PercentMatrix)base.AsReadOnly();
     90    }
    8791  }
    8892}
  • branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/PercentValue.cs

    r17226 r17253  
    2121
    2222using System;
     23using HEAL.Attic;
    2324using HeuristicLab.Common;
    2425using HeuristicLab.Core;
    25 using HEAL.Attic;
    2626
    2727namespace HeuristicLab.Data {
     
    5151    }
    5252    public PercentValue() : base() { }
    53     public PercentValue(double value) : base(value) { }
    54 
    55     public PercentValue(double value, bool restrictToUnitInterval)
     53    public PercentValue(double value, bool @readonly = false) : base(value, @readonly) { }
     54    // TODO: suggest to remove the following constructor [ABE]
     55    public PercentValue(double value, bool restrictToUnitInterval, bool @readonly = false)
    5656      : base() {
    5757      this.restrictToUnitInterval = restrictToUnitInterval;
     
    5959        throw new ArgumentException("Value must lie in the interval [0,1].");
    6060      this.value = value;
     61      this.readOnly = @readonly;
    6162    }
    6263
     
    101102      }
    102103    }
     104
     105    public new PercentValue AsReadOnly() {
     106      return (PercentValue)base.AsReadOnly();
     107    }
    103108  }
    104109}
  • branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/StringArray.cs

    r17226 r17253  
    2626using System.Linq;
    2727using System.Text;
     28using HEAL.Attic;
    2829using HeuristicLab.Common;
    2930using HeuristicLab.Core;
    30 using HEAL.Attic;
    3131
    3232namespace HeuristicLab.Data {
     
    131131      elementNames = new List<string>();
    132132    }
    133     public StringArray(string[] elements) {
     133    public StringArray(string[] elements, bool @readonly = false) {
    134134      if (elements == null) throw new ArgumentNullException();
    135135      array = new string[elements.Length];
    136136      for (int i = 0; i < array.Length; i++)
    137137        array[i] = elements[i] == null ? string.Empty : elements[i];
    138       readOnly = false;
     138      readOnly = @readonly;
    139139      resizable = true;
    140140      elementNames = new List<string>();
     
    146146
    147147    public virtual StringArray AsReadOnly() {
    148       StringArray readOnlyStringArray = (StringArray)this.Clone();
    149       readOnlyStringArray.readOnly = true;
    150       return readOnlyStringArray;
     148      if (ReadOnly) return this;
     149      var clone = (StringArray)this.Clone();
     150      clone.readOnly = true;
     151      return clone;
    151152    }
    152153    IValueTypeArray IValueTypeArray.AsReadOnly() {
  • branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/StringConvertibleArray.cs

    r17226 r17253  
    2222#endregion
    2323
     24using HEAL.Attic;
    2425using HeuristicLab.Common;
    2526using HeuristicLab.Core;
    26 using HEAL.Attic;
    2727
    2828namespace HeuristicLab.Data {
     
    3737    protected StringConvertibleArray() : base() { }
    3838    protected StringConvertibleArray(int length) : base(length) { }
    39     protected StringConvertibleArray(T[] elements) : base(elements) { }
     39    protected StringConvertibleArray(T[] elements, bool @readonly = false) : base(elements, @readonly) { }
    4040
    4141    protected abstract bool Validate(string value, out string errorMessage);
  • branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/StringMatrix.cs

    r17226 r17253  
    2626using System.Linq;
    2727using System.Text;
     28using HEAL.Attic;
    2829using HeuristicLab.Common;
    2930using HeuristicLab.Core;
    30 using HEAL.Attic;
    3131
    3232namespace HeuristicLab.Data {
     
    178178      RowNames = rowNames;
    179179    }
    180     public StringMatrix(string[,] elements) {
     180    public StringMatrix(string[,] elements, bool @readonly = false) {
    181181      if (elements == null) throw new ArgumentNullException();
    182182      matrix = new string[elements.GetLength(0), elements.GetLength(1)];
     
    188188      rowNames = new List<string>();
    189189      sortableView = false;
    190       readOnly = false;
    191     }
    192     protected StringMatrix(string[,] elements, IEnumerable<string> columnNames)
    193       : this(elements) {
     190      readOnly = @readonly;
     191    }
     192    protected StringMatrix(string[,] elements, IEnumerable<string> columnNames, bool @readonly = false)
     193      : this(elements, @readonly) {
    194194      ColumnNames = columnNames;
    195195    }
    196     protected StringMatrix(string[,] elements, IEnumerable<string> columnNames, IEnumerable<string> rowNames)
    197       : this(elements, columnNames) {
     196    protected StringMatrix(string[,] elements, IEnumerable<string> columnNames, IEnumerable<string> rowNames, bool @readonly = false)
     197      : this(elements, columnNames, @readonly ) {
    198198      RowNames = rowNames;
    199199    }
     
    204204
    205205    public virtual StringMatrix AsReadOnly() {
    206       StringMatrix readOnlyStringMatrix = (StringMatrix)this.Clone();
    207       readOnlyStringMatrix.readOnly = true;
    208       return readOnlyStringMatrix;
     206      if (ReadOnly) return this;
     207      var clone = (StringMatrix)this.Clone();
     208      clone.readOnly = true;
     209      return clone;
    209210    }
    210211
  • branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/StringValue.cs

    r17226 r17253  
    2222using System;
    2323using System.Drawing;
     24using HEAL.Attic;
    2425using HeuristicLab.Common;
    2526using HeuristicLab.Core;
    26 using HEAL.Attic;
    2727
    2828namespace HeuristicLab.Data {
     
    6666      this.readOnly = false;
    6767    }
    68     public StringValue(string value) {
     68    public StringValue(string value, bool @readonly = false) {
    6969      this.value = value != null ? value : string.Empty;
    70       this.readOnly = false;
     70      this.readOnly = @readonly;
    7171    }
    7272
     
    7676
    7777    public virtual StringValue AsReadOnly() {
    78       StringValue readOnlyStringValue = (StringValue)this.Clone();
    79       readOnlyStringValue.readOnly = true;
    80       return readOnlyStringValue;
     78      if (ReadOnly) return this;
     79      var clone = (StringValue)this.Clone();
     80      clone.readOnly = true;
     81      return clone;
    8182    }
    8283
  • branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/TextValue.cs

    r17226 r17253  
    2020#endregion
    2121
     22using HEAL.Attic;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    24 using HEAL.Attic;
    2525
    2626namespace HeuristicLab.Data {
     
    2929  public class TextValue : StringValue, ITextValue {
    3030
    31     public TextValue() {
    32       this.value = string.Empty;
    33       this.readOnly = false;
    34     }
    35 
    36     public TextValue(string value) {
    37       this.value = value ?? string.Empty;
    38       this.readOnly = false;
    39     }
     31    public TextValue() : base() { }
     32    public TextValue(string value, bool @readonly = false) : base(value ?? string.Empty, @readonly) { }
    4033
    4134    [StorableConstructor]
    4235    protected TextValue(StorableConstructorFlag _) : base(_) { }
    4336
    44     protected TextValue(TextValue original, Cloner cloner)
    45       : base(original, cloner) {
    46       this.value = original.value ?? string.Empty;
    47       this.readOnly = original.readOnly;
    48     }
     37    protected TextValue(TextValue original, Cloner cloner) : base(original, cloner) { }
    4938
    5039    public override IDeepCloneable Clone(Cloner cloner) {
  • branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/TimeSpanValue.cs

    r17226 r17253  
    2323using System.Globalization;
    2424using System.Text;
     25using HEAL.Attic;
    2526using HeuristicLab.Common;
    2627using HeuristicLab.Core;
    27 using HEAL.Attic;
    2828
    2929namespace HeuristicLab.Data {
     
    3737    }
    3838    public TimeSpanValue() : base() { }
    39     public TimeSpanValue(TimeSpan value) : base(value) { }
     39    public TimeSpanValue(TimeSpan value, bool @readonly = false) : base(value, @readonly) { }
    4040
    4141    public override IDeepCloneable Clone(Cloner cloner) {
     
    8080    }
    8181
     82    public new TimeSpanValue AsReadOnly() {
     83      return (TimeSpanValue)base.AsReadOnly();
     84    }
     85
    8286    #region IStringConvertibleValue Members
    8387    bool IStringConvertibleValue.Validate(string value, out string errorMessage) {
  • branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/ValueTypeArray.cs

    r17226 r17253  
    2626using System.Linq;
    2727using System.Text;
     28using HEAL.Attic;
    2829using HeuristicLab.Common;
    2930using HeuristicLab.Core;
    30 using HEAL.Attic;
    3131
    3232namespace HeuristicLab.Data {
     
    137137      elementNames = new List<string>();
    138138    }
    139     protected ValueTypeArray(T[] elements) {
     139    protected ValueTypeArray(T[] elements, bool @readonly = false) {
    140140      if (elements == null) throw new ArgumentNullException();
    141141      array = (T[])elements.Clone();
    142       readOnly = false;
     142      readOnly = @readonly;
    143143      resizable = true;
    144144      elementNames = new List<string>();
     
    146146
    147147    public virtual IValueTypeArray AsReadOnly() {
    148       ValueTypeArray<T> readOnlyValueTypeArray = (ValueTypeArray<T>)this.Clone();
    149       readOnlyValueTypeArray.readOnly = true;
    150       return readOnlyValueTypeArray;
     148      if (ReadOnly) return this;
     149      var clone = (ValueTypeArray<T>)this.Clone();
     150      clone.readOnly = true;
     151      return clone;
    151152    }
    152153
  • branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/ValueTypeMatrix.cs

    r17251 r17253  
    190190
    191191    public virtual ValueTypeMatrix<T> AsReadOnly() {
    192       if (readOnly) return this;
    193       var readOnlyValueTypeMatrix = (ValueTypeMatrix<T>)this.Clone();
    194       readOnlyValueTypeMatrix.readOnly = true;
    195       return readOnlyValueTypeMatrix;
     192      if (ReadOnly) return this;
     193      var clone = (ValueTypeMatrix<T>)this.Clone();
     194      clone.readOnly = true;
     195      return clone;
    196196    }
    197197
  • branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/ValueTypeValue.cs

    r17226 r17253  
    2222using System;
    2323using System.Drawing;
     24using HEAL.Attic;
    2425using HeuristicLab.Common;
    2526using HeuristicLab.Core;
    26 using HEAL.Attic;
    2727
    2828namespace HeuristicLab.Data {
     
    6464      this.readOnly = false;
    6565    }
    66     protected ValueTypeValue(T value) {
     66    protected ValueTypeValue(T value, bool @readonly = false) {
    6767      this.value = value;
    68       this.readOnly = false;
     68      this.readOnly = @readonly;
    6969    }
    7070
    7171    public virtual ValueTypeValue<T> AsReadOnly() {
    72       ValueTypeValue<T> readOnlyValueTypeValue = (ValueTypeValue<T>)this.Clone();
    73       readOnlyValueTypeValue.readOnly = true;
    74       return readOnlyValueTypeValue;
     72      if (ReadOnly) return this;
     73      var clone = (ValueTypeValue<T>)this.Clone();
     74      clone.readOnly = true;
     75      return clone;
    7576    }
    7677
Note: See TracChangeset for help on using the changeset viewer.