private void toolStripComboBox1_SelectedIndexChanged(object sender, EventArgs e) { Config c = new Config(); foreach (Config cf in configurations.confs) if (cf.name == toolStripComboBox1.Text) c = cf; textBox1.Text = c.ip; textBox2.Text = c.mask; textBox4.Text = c.gw; textBox3.Lines = c.dns; if (c.dhcp == true) dhcp.Checked = true; }
private void Save_Click(object sender, EventArgs e) { Config cf = new Config(); cf.name = toolStripComboBox1.Text; cf.ip = textBox1.Text; cf.mask = textBox2.Text; cf.gw = textBox4.Text; cf.dns = textBox3.Lines; configurations.confs.Add(cf); Serialize(); Deserialize(); Initialize(); }