public Sensor() { myHelper = new ViewComponentHelper(this); InitializeComponent(); previous = customRadioButton1; }
private void customRadioButton3_CheckedChanged(object sender, EventArgs e) { label2.Enabled = customRadioButton1.Checked; nndRange.Enabled = customRadioButton1.Checked; customParameterEnumBox1.Enabled = customRadioButton2.Checked; listBoxCustomAttributes.Enabled = customRadioButton3.Checked; previous = customRadioButton3; }
private void customRadioButton1_CheckedChanged(object sender, EventArgs e) { label2.Enabled = customRadioButton1.Checked; nndRange.Enabled = customRadioButton1.Checked; customParameterEnumBox1.Enabled = customRadioButton2.Checked; listBoxCustomAttributes.Enabled = customRadioButton3.Checked; if (customRadioButton1.Checked) { ComponentOptions c = new ComponentOptions(); c.CompParams = true; IXPathNavigable iNavParameters = controller.GetComponentAndChildren(sensorId, "Scenario", c); XPathNavigator navParameters = iNavParameters.CreateNavigator(); XPathNodeIterator itr = navParameters.Select(".//Component[@Type='SensorRange']"); if (itr.Count > 0) { if (MessageBox.Show("Selecting this option will delete this sensor's existing Sensor Ranges.\nDo you want to continue?", "Delete Sensor Ranges", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { foreach (XPathNavigator node in itr) { String attributeValue = node.GetAttribute("ID", node.NamespaceURI); if (attributeValue != string.Empty) { controller.DeleteComponent(Convert.ToInt32(attributeValue)); } } } else { previous.Checked = true; } } } previous = customRadioButton1; }