2 using System.Collections.Generic;
6 using System.Windows.Controls;
7 using System.Windows.Data;
8 using System.Windows.Documents;
9 using System.Windows.Input;
10 using System.Windows.Media;
11 using System.Windows.Media.Imaging;
12 using System.Windows.Navigation;
13 using System.Windows.Shapes;
15 using System.Globalization;
17 namespace SeciControls
24 private DataTable
_dt;
28 InitializeComponent();
33 _dt =
new DataTable(
"SampleInfo");
34 _dt.Columns.Add(
"Name", typeof(
string));
35 _dt.Columns.Add(
"Type", typeof(
string));
36 _dt.Columns.Add(
"Units", typeof(
string));
37 _dt.Columns.Add(
"Value", typeof(
string));
44 String[,] parameters = Seci.Standard.SampleParameters.GetParameters();
46 if (parameters != null)
48 for (
int i = 0; i < parameters.GetLength(0); ++i)
50 _dt.Rows.Add(parameters[i,0], parameters[i,1], parameters[i,2], parameters[i,3]);
53 dgSampleInfo.ItemsSource = _dt.DefaultView;
56 for (
int i = 0; i < dgSampleInfo.Columns.Count; ++i)
58 dgSampleInfo.Columns[i].Width = 0;
59 dgSampleInfo.Columns[i].Width = DataGridLength.SizeToCells;
67 if (add.ShowDialog() == System.Windows.Forms.DialogResult.OK)
77 if (dgSampleInfo.SelectedIndex != -1)
79 Seci.Standard.SampleParameters.RemoveParameter(_dt.Rows[dgSampleInfo.SelectedIndex][0].ToString());
80 System.Threading.Thread.Sleep(500);
84 MessageBox.Show(
"Please select a property to remove.",
"Select a Property", MessageBoxButton.OK, MessageBoxImage.Warning);