private void pictureBox_Click(object sender, EventArgs e) { if (state == AUSGELOEST) { this.pictureBox.Image = freiImage; state = AKTIVE; } else { state = AUSGELOEST; this.pictureBox.Image = ausgeloestImage; foreach (Control cc in Form1.instanceBedienpanel.Controls) { if (cc.HasChildren) { if (cc is Bedienelement) { Bedienelement z = (Bedienelement)cc; if (z.mitNotaus()) { z.notAus(true); } } } } } }
public void setControl(Control c) { myControl = c; Bedienelement b = (Bedienelement)myControl; beschriftungtextBox.Text = b.getBeschriftung(); tastergroupBox.Enabled = false; leuchtmeldergroupBox.Enabled = false; if (b.getType() == Bedienelement.Blindelement) { blindelementradioButton.Checked = true; } else if (b.getType() == Bedienelement.Leuchtmelder) { leuchtmlederradioButton.Checked = true; } else if (b.getType() == Bedienelement.Taster) { tasterradioButton.Checked = true; } else if (b.getType() == Bedienelement.LeuchtTaster) { leuchttasterradioButton.Checked = true; } else if (b.getType() == Bedienelement.Schalter) { schalterradioButton1.Checked = true; } else if (b.getType() == Bedienelement.FarbSchalter) { farbschalterradioButton.Checked = true; } farbecomboBox.SelectedIndex = b.getLeuchtmlederFarbe(); LeuchtmelderAdrtextBox.Text = b.getLeuchtmelderAdr(); tasterAdrtextBox.Text = b.getTasterAdr(); tastertastetextBox.Text = b.getTasterTaste().ToString(); schliesserradioButton.Checked = b.isSchliesser(); oeffnerradioButton.Checked = !b.isSchliesser(); notuuscheckBox.Checked = b.mitNotaus(); textBoxname.Text = b.Name; }
private void freigabe(Boolean b) { if (state == AKTIVE) { if (b) { this.setState(FREI); foreach (Control cc in Form1.instanceBedienpanel.Controls) { if (cc.HasChildren) { if (cc is Bedienelement) { Bedienelement z = (Bedienelement)cc; if (z.mitNotaus()) { z.notAus(false); } } } } } } }