2 using System.Collections.Generic;
3 using System.ComponentModel;
8 using System.Windows.Forms;
10 namespace SeciControls
26 comName.Items.AddRange(_parameterNames.ToArray());
27 comType2.Items.AddRange(_parameterTypes.ToArray());
29 comType.SelectedIndex = 0;
36 txtName.Visible =
false;
37 txtUnits.Visible =
false;
38 comType2.Visible =
false;
39 lblUnits.Visible =
false;
40 lblType.Visible =
false;
42 comName.Visible =
true;
46 txtName.Visible =
true;
47 txtUnits.Visible =
true;
48 comType2.Visible =
true;
49 lblUnits.Visible =
true;
50 lblType.Visible =
true;
52 comName.Visible =
false;
58 DialogResult = DialogResult.Cancel;
69 if (
comName.SelectedIndex != -1 && !String.IsNullOrEmpty(
txtValue.Text))
71 Seci.Standard.SampleParameters.CreateParameter(comName.SelectedIndex, txtValue.Text);
75 MessageBox.Show(
"Please make sure all values have been entered correctly.",
"Missing Values", MessageBoxButtons.OK, MessageBoxIcon.Error);
79 else if (
comType.SelectedIndex == 1)
82 if (
comType.SelectedIndex != -1 && !String.IsNullOrEmpty(
txtName.Text) && !String.IsNullOrEmpty(txtValue.Text))
84 Seci.Standard.SampleParameters.CreateParameter(txtName.Text, comType2.SelectedIndex, txtUnits.Text, txtValue.Text);
88 MessageBox.Show(
"Please make sure all values have been entered correctly.",
"Missing Values", MessageBoxButtons.OK, MessageBoxIcon.Error);
95 MessageBox.Show(err.Message,
"Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
99 System.Threading.Thread.Sleep(500);
101 DialogResult = DialogResult.OK;
System.Windows.Forms.TextBox txtValue
void comType_SelectedIndexChanged(object sender, EventArgs e)
System.Windows.Forms.ComboBox comType
System.Windows.Forms.ComboBox comName
void AddSampleParameter_Load(object sender, EventArgs e)
void btnAdd_Click(object sender, EventArgs e)
void InitializeComponent()
Required method for Designer support - do not modify the contents of this method with the code editor...
void btnCancel_Click(object sender, EventArgs e)
System.Windows.Forms.TextBox txtName
List< String > _parameterTypes
List< String > _parameterNames