- Timestamp:
- 04/30/10 04:53:40 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Analysis.Views/3.3/DataTableView.cs
r3533 r3561 222 222 Invoke(new CollectionItemsChangedEventHandler<IndexedItem<double>>(Values_ItemsAdded), sender, e); 223 223 else { 224 DataRow row = valuesRowsTable[(IObservableList<double>)sender]; 225 foreach (IndexedItem<double> item in e.Items) { 226 var value = item.Value; 227 if (IsInvalidValue(item.Value)) { 228 DataPoint point = new DataPoint(); 229 point.IsEmpty = true; 230 chart.Series[row.Name].Points.Insert(item.Index, point); 231 } else { 232 chart.Series[row.Name].Points.InsertY(item.Index, value); 224 DataRow row = null; 225 valuesRowsTable.TryGetValue((IObservableList<double>)sender, out row); 226 if (row != null) { 227 foreach (IndexedItem<double> item in e.Items) { 228 var value = item.Value; 229 if (IsInvalidValue(item.Value)) { 230 DataPoint point = new DataPoint(); 231 point.IsEmpty = true; 232 chart.Series[row.Name].Points.Insert(item.Index, point); 233 } else { 234 chart.Series[row.Name].Points.InsertY(item.Index, value); 235 } 233 236 } 234 237 } … … 239 242 Invoke(new CollectionItemsChangedEventHandler<IndexedItem<double>>(Values_ItemsRemoved), sender, e); 240 243 else { 241 DataRow row = valuesRowsTable[(IObservableList<double>)sender]; 242 List<DataPoint> points = new List<DataPoint>(); 243 foreach (IndexedItem<double> item in e.Items) 244 points.Add(chart.Series[row.Name].Points[item.Index]); 245 foreach (DataPoint point in points) 246 chart.Series[row.Name].Points.Remove(point); 244 DataRow row = null; 245 valuesRowsTable.TryGetValue((IObservableList<double>)sender, out row); 246 if (row != null) { 247 List<DataPoint> points = new List<DataPoint>(); 248 foreach (IndexedItem<double> item in e.Items) 249 points.Add(chart.Series[row.Name].Points[item.Index]); 250 foreach (DataPoint point in points) 251 chart.Series[row.Name].Points.Remove(point); 252 } 247 253 } 248 254 } … … 251 257 Invoke(new CollectionItemsChangedEventHandler<IndexedItem<double>>(Values_ItemsReplaced), sender, e); 252 258 else { 253 DataRow row = valuesRowsTable[(IObservableList<double>)sender]; 254 foreach (IndexedItem<double> item in e.Items) { 255 if (IsInvalidValue(item.Value)) 256 chart.Series[row.Name].Points[item.Index].IsEmpty = true; 257 else { 258 chart.Series[row.Name].Points[item.Index].YValues = new double[] { item.Value }; 259 chart.Series[row.Name].Points[item.Index].IsEmpty = false; 259 DataRow row = null; 260 valuesRowsTable.TryGetValue((IObservableList<double>)sender, out row); 261 if (row != null) { 262 foreach (IndexedItem<double> item in e.Items) { 263 if (IsInvalidValue(item.Value)) 264 chart.Series[row.Name].Points[item.Index].IsEmpty = true; 265 else { 266 chart.Series[row.Name].Points[item.Index].YValues = new double[] { item.Value }; 267 chart.Series[row.Name].Points[item.Index].IsEmpty = false; 268 } 260 269 } 261 270 } … … 266 275 Invoke(new CollectionItemsChangedEventHandler<IndexedItem<double>>(Values_ItemsMoved), sender, e); 267 276 else { 268 DataRow row = valuesRowsTable[(IObservableList<double>)sender]; 269 foreach (IndexedItem<double> item in e.Items) { 270 if (IsInvalidValue(item.Value)) 271 chart.Series[row.Name].Points[item.Index].IsEmpty = true; 272 else { 273 chart.Series[row.Name].Points[item.Index].YValues = new double[] { item.Value }; 274 chart.Series[row.Name].Points[item.Index].IsEmpty = false; 277 DataRow row = null; 278 valuesRowsTable.TryGetValue((IObservableList<double>)sender, out row); 279 if (row != null) { 280 foreach (IndexedItem<double> item in e.Items) { 281 if (IsInvalidValue(item.Value)) 282 chart.Series[row.Name].Points[item.Index].IsEmpty = true; 283 else { 284 chart.Series[row.Name].Points[item.Index].YValues = new double[] { item.Value }; 285 chart.Series[row.Name].Points[item.Index].IsEmpty = false; 286 } 275 287 } 276 288 } … … 282 294 Invoke(new CollectionItemsChangedEventHandler<IndexedItem<double>>(Values_CollectionReset), sender, e); 283 295 else { 284 DataRow row = valuesRowsTable[(IObservableList<double>)sender]; 285 chart.Series[row.Name].Points.Clear(); 286 foreach (IndexedItem<double> item in e.Items) { 287 if (IsInvalidValue(item.Value)) 288 chart.Series[row.Name].Points[item.Index].IsEmpty = true; 289 else { 290 chart.Series[row.Name].Points[item.Index].YValues = new double[] { item.Value }; 291 chart.Series[row.Name].Points[item.Index].IsEmpty = false; 296 DataRow row = null; 297 valuesRowsTable.TryGetValue((IObservableList<double>)sender, out row); 298 if (row != null) { 299 chart.Series[row.Name].Points.Clear(); 300 foreach (IndexedItem<double> item in e.Items) { 301 if (IsInvalidValue(item.Value)) 302 chart.Series[row.Name].Points[item.Index].IsEmpty = true; 303 else { 304 chart.Series[row.Name].Points[item.Index].YValues = new double[] { item.Value }; 305 chart.Series[row.Name].Points[item.Index].IsEmpty = false; 306 } 292 307 } 293 308 }
Note: See TracChangeset
for help on using the changeset viewer.