- Timestamp:
- 09/16/19 16:12:21 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Data/3.3/ValueTypeValue.cs
r17226 r17253 22 22 using System; 23 23 using System.Drawing; 24 using HEAL.Attic; 24 25 using HeuristicLab.Common; 25 26 using HeuristicLab.Core; 26 using HEAL.Attic;27 27 28 28 namespace HeuristicLab.Data { … … 64 64 this.readOnly = false; 65 65 } 66 protected ValueTypeValue(T value ) {66 protected ValueTypeValue(T value, bool @readonly = false) { 67 67 this.value = value; 68 this.readOnly = false;68 this.readOnly = @readonly; 69 69 } 70 70 71 71 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; 75 76 } 76 77
Note: See TracChangeset
for help on using the changeset viewer.