private void buttonSelectTag_Click(object sender, EventArgs e) { //"Reference", //"Value", //"Constant" bool ret = true; DialogResult result = DialogResult.OK; VarType _type; //do //{ if (((string)comboBoxReference.SelectedItem == "Reference") || ((string)comboBoxReference.SelectedItem == "Value")) { VariableForm varlistfrm = new VariableForm(); if (DialogResult.OK == varlistfrm.ShowDialog()) { if ((string)comboBoxReference.SelectedItem == "Reference") { if (varlistfrm.IsReference) { _type = (VarType)varlistfrm.tblvariable.Type; if ((string)comboBoxType.SelectedItem == _type.ToString()) { textBoxAssignment.Text = varlistfrm.Resultstr; ret = false; } else { MessageBox.Show("Selected tag type doesn't match with selected type"); } } else { MessageBox.Show("Selected tag is not reference", "Error"); } } if ((string)comboBoxReference.SelectedItem == "Value") { if (varlistfrm.SubPropertyTxt != "") { _type = VarType.BOOL; } else { _type = (VarType)varlistfrm.tblformalparameter.Type; } if (!varlistfrm.IsReference) { if ((string)comboBoxType.SelectedItem == _type.ToString()) { textBoxAssignment.Text = varlistfrm.Resultstr; ret = false; } else { MessageBox.Show("Selected tag type doesn't match with selected type"); } } else { MessageBox.Show("Selected tag is not Value"); } } //if (result == DialogResult.Cancel) //{ // textBoxAssignment.Text = ""; // ret = false; //} } else { ret = false; } } //} while (ret); }
public AreaSelectForm(VariableForm _parent) { parent = _parent; InitializeComponent(); Initialize(); }