Changeset 15280 for branches/Async/HeuristicLab.Data/3.3/StringArray.cs
- Timestamp:
- 07/23/17 00:52:14 (7 years ago)
- Location:
- branches/Async
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Async
- Property svn:mergeinfo changed
-
branches/Async/HeuristicLab.Data/3.3
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Data/3.3 (added) merged: 13397,13695
- Property svn:mergeinfo changed
-
branches/Async/HeuristicLab.Data/3.3/StringArray.cs
r12012 r15280 61 61 public virtual int Length { 62 62 get { return array.Length; } 63 protectedset {63 set { 64 64 if (ReadOnly) throw new NotSupportedException("Length cannot be set. StringArray is read-only."); 65 65 if (value != Length) { … … 72 72 } 73 73 } 74 [Storable] 75 protected bool resizable = true; 76 public bool Resizable { 77 get { return resizable; } 78 set { 79 if (resizable != value) { 80 resizable = value; 81 OnResizableChanged(); 82 } 83 } 84 } 85 74 86 public virtual string this[int index] { 75 87 get { return array[index]; } … … 102 114 this.array = (string[])original.array.Clone(); 103 115 this.readOnly = original.readOnly; 116 this.resizable = original.resizable; 104 117 this.elementNames = new List<string>(original.elementNames); 105 118 } … … 107 120 array = new string[0]; 108 121 readOnly = false; 122 resizable = true; 109 123 elementNames = new List<string>(); 110 124 } … … 114 128 array[i] = string.Empty; 115 129 readOnly = false; 130 resizable = true; 116 131 elementNames = new List<string>(); 117 132 } … … 122 137 array[i] = elements[i] == null ? string.Empty : elements[i]; 123 138 readOnly = false; 139 resizable = true; 124 140 elementNames = new List<string>(); 125 141 } … … 133 149 readOnlyStringArray.readOnly = true; 134 150 return readOnlyStringArray; 151 } 152 IValueTypeArray IValueTypeArray.AsReadOnly() { 153 return AsReadOnly(); 135 154 } 136 155 … … 155 174 return array.Cast<string>().GetEnumerator(); 156 175 } 157 158 176 IEnumerator IEnumerable.GetEnumerator() { 159 177 return GetEnumerator(); … … 181 199 } 182 200 201 public event EventHandler ResizableChanged; 202 protected virtual void OnResizableChanged() { 203 EventHandler handler = ResizableChanged; 204 if (handler != null) 205 handler(this, EventArgs.Empty); 206 } 183 207 public event EventHandler ElementNamesChanged; 184 208 protected virtual void OnElementNamesChanged() { … … 187 211 handler(this, EventArgs.Empty); 188 212 } 189 190 213 public event EventHandler<EventArgs<int>> ItemChanged; 191 214 protected virtual void OnItemChanged(int index) { … … 203 226 204 227 #region IStringConvertibleArray Members 205 int IStringConvertibleArray.Length {206 get { return Length; }207 set { Length = value; }208 }209 228 bool IStringConvertibleArray.Validate(string value, out string errorMessage) { 210 229 return Validate(value, out errorMessage);
Note: See TracChangeset
for help on using the changeset viewer.