private void add_bAddRule_Click(object sender, EventArgs e) { //Save the new Device. add_bSaveNewDevice.PerformClick(); //Create and display the DataBoard form. var window = new DataBoard(_communicator, _selectedDevice); window.GoToRulePage(); window.ShowDialog(); //Get the Comm object created. _rule = window.GetRule(); //Update the labels. UpdateStartLabels(); }
private void modify_bRules_Click(object sender, EventArgs e) { //Loads the relevant communicators. var controller = new RuleController(); modrules_lbRules.Items.Clear(); modrules_lbRules.Items.AddRange( controller.RetrieveRulesForDevice(_selectedDevice.Id).ToArray()); if (modrules_lbRules.Items.Count > 0) { //Select the first element modrules_lbRules.SelectedItem = modrules_lbRules.Items[0]; //Shows the modify tab. pTabPanel.SelectedTab = pModifyRules; } else { var msg = System.Windows.Forms.MessageBox.Show( "There are no Rules for this Device.", "No Rules Available", MessageBoxButtons.OK, MessageBoxIcon.Hand); // -------- Create new rule ---------- //Create and display the DataBoard form. var window = new DataBoard(null, _selectedDevice); window.GoToRulePage(); window.ShowDialog(); //Get the Comm object created. _rule = window.GetRule(); } }
private void modrules_bAddNewRule_Click(object sender, EventArgs e) { //Create and display the DataBoard form. var window = new DataBoard(_communicator, _selectedDevice); window.GoToRulePage(); window.ShowDialog(); //Get the Comm object created. _rule = window.GetRule(); //Return to Device list modrules_tBack.PerformClick(); }