Changeset 13979 for stable/HeuristicLab.Data/3.3/ValueTypeArray.cs
- Timestamp:
- 07/02/16 14:03:54 (8 years ago)
- Location:
- stable
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 13695
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Data/3.3
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Data/3.3 merged: 13695
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Data/3.3/ValueTypeArray.cs
r12009 r13979 33 33 [Item("ValueTypeArray", "An abstract base class for representing arrays of value types.")] 34 34 [StorableClass] 35 public abstract class ValueTypeArray<T> : Item, I Enumerable<T> where T : struct {35 public abstract class ValueTypeArray<T> : Item, IValueTypeArray<T> where T : struct { 36 36 private const int maximumToStringLength = 100; 37 37 … … 75 75 #endregion 76 76 } 77 78 [Storable] 79 protected bool resizable = true; 80 public bool Resizable { 81 get { return resizable; } 82 set { 83 if (resizable != value) { 84 resizable = value; 85 OnResizableChanged(); 86 } 87 } 88 } 89 90 77 91 public virtual T this[int index] { 78 92 get { return array[index]; } … … 103 117 this.array = (T[])original.array.Clone(); 104 118 this.readOnly = original.readOnly; 119 this.resizable = original.resizable; 105 120 this.elementNames = new List<string>(original.elementNames); 106 121 } … … 108 123 array = new T[0]; 109 124 readOnly = false; 125 resizable = true; 110 126 elementNames = new List<string>(); 111 127 } … … 113 129 array = new T[length]; 114 130 readOnly = false; 131 resizable = true; 115 132 elementNames = new List<string>(); 116 133 } … … 119 136 array = (T[])elements.Clone(); 120 137 readOnly = false; 138 resizable = true; 121 139 elementNames = new List<string>(); 122 140 } 123 141 124 public virtual ValueTypeArray<T>AsReadOnly() {142 public virtual IValueTypeArray AsReadOnly() { 125 143 ValueTypeArray<T> readOnlyValueTypeArray = (ValueTypeArray<T>)this.Clone(); 126 144 readOnlyValueTypeArray.readOnly = true; … … 153 171 } 154 172 173 public event EventHandler ResizableChanged; 174 protected virtual void OnResizableChanged() { 175 EventHandler handler = ResizableChanged; 176 if (handler != null) 177 handler(this, EventArgs.Empty); 178 } 155 179 public event EventHandler ElementNamesChanged; 156 180 protected virtual void OnElementNamesChanged() {
Note: See TracChangeset
for help on using the changeset viewer.