Initial Commit

This commit is contained in:
2024-02-23 00:46:06 -05:00
commit 2bbedc0178
470 changed files with 46035 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
using System.Data;
using System.Linq;
using System.Windows;
using System.Collections.Generic;
namespace Microsoft.Research.DynamicDataDisplay.DataSources
{
/// <summary>Data source that extracts sequence of points and their attributes from DataTable</summary>
public class TableDataSource : EnumerableDataSource<DataRow>
{
public TableDataSource(DataTable table)
: base(table.Rows)
{
// Subscribe to DataTable events
table.TableNewRow += NewRowInsertedHandler;
table.RowChanged += RowChangedHandler;
table.RowDeleted += RowChangedHandler;
}
private void RowChangedHandler(object sender, DataRowChangeEventArgs e)
{
RaiseDataChanged();
}
private void NewRowInsertedHandler(object sender, DataTableNewRowEventArgs e)
{
// Raise DataChanged event. ChartPlotter should redraw graph.
// This will be done automatically when rows are added to table.
RaiseDataChanged();
}
}
}