Changeset 12489
- Timestamp:
- 06/22/15 17:08:16 (10 years ago)
- Location:
- branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/Dataset.cs
r12452 r12489 230 230 } 231 231 232 public event EventHandler ColumnsChanged { add { } remove { } }233 public event EventHandler RowsChanged { add { } remove { } }234 public event EventHandler ColumnNamesChanged { add { } remove { } }235 public event EventHandler RowNamesChanged { add { } remove { } }236 public event EventHandler SortableViewChanged { add { } remove { } }237 public event EventHandler<EventArgs<int, int>> ItemChanged { add { } remove { } }238 public event EventHandler Reset { add { } remove { } }232 public virtual event EventHandler ColumnsChanged { add { } remove { } } 233 public virtual event EventHandler RowsChanged { add { } remove { } } 234 public virtual event EventHandler ColumnNamesChanged { add { } remove { } } 235 public virtual event EventHandler RowNamesChanged { add { } remove { } } 236 public virtual event EventHandler SortableViewChanged { add { } remove { } } 237 public virtual event EventHandler<EventArgs<int, int>> ItemChanged { add { } remove { } } 238 public virtual event EventHandler Reset { add { } remove { } } 239 239 #endregion 240 240 } -
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/ModifiableDataset.cs
r12190 r12489 56 56 variableValues[variableNames[i]][row] = list[i]; 57 57 } 58 OnRowsChanged(); 59 OnReset(); 58 60 } 59 61 … … 73 75 } 74 76 rows++; 77 OnRowsChanged(); 78 OnReset(); 75 79 } 76 80 … … 84 88 variableValues[variableName] = new List<T>(values); 85 89 variableNames.Add(variableName); 90 OnColumnsChanged(); 91 OnColumnNamesChanged(); 92 OnReset(); 86 93 } 87 94 … … 91 98 variableValues.Remove(variableName); 92 99 variableNames.Remove(variableName); 100 OnColumnsChanged(); 101 OnColumnNamesChanged(); 102 OnReset(); 93 103 } 94 104 … … 98 108 list.RemoveAt(row); 99 109 rows--; 110 OnRowsChanged(); 111 OnReset(); 100 112 } 101 113 … … 158 170 return false; 159 171 } 172 173 #region event handlers 174 public override event EventHandler RowsChanged; 175 private void OnRowsChanged() { 176 var changed = RowsChanged; 177 if (changed != null) 178 changed(this, EventArgs.Empty); 179 } 180 181 public override event EventHandler ColumnsChanged; 182 private void OnColumnsChanged() { 183 var changed = ColumnsChanged; 184 if (changed != null) 185 changed(this, EventArgs.Empty); 186 } 187 188 public override event EventHandler RowNamesChanged; 189 private void OnRowNamesChanged() { 190 var changed = RowNamesChanged; 191 if (changed != null) 192 changed(this, EventArgs.Empty); 193 } 194 195 public override event EventHandler ColumnNamesChanged; 196 private void OnColumnNamesChanged() { 197 var changed = ColumnNamesChanged; 198 if (changed != null) 199 changed(this, EventArgs.Empty); 200 } 201 202 public override event EventHandler Reset; 203 private void OnReset() { 204 var reset = Reset; 205 if (reset != null) 206 reset(this, EventArgs.Empty); 207 } 208 209 // not sure if this is really applicable in the ModifiableDataset 210 // since this is not a matrix and values are changed based on row + variableName 211 public override event EventHandler<EventArgs<int, int>> ItemChanged; 212 private void OnItemChanged(int rowIndex, int columnIndex) { 213 var changed = ItemChanged; 214 if (changed != null) { 215 changed(this, new EventArgs<int, int>(rowIndex, columnIndex)); 216 } 217 } 218 #endregion 160 219 } 161 220 }
Note: See TracChangeset
for help on using the changeset viewer.