private void ApplySettings(IControlLoad load) { foreach (Control c in groupParameters.Controls) { SaveLoad.loadControl(load, c); } configureEverything(); }
private void loadControls(IControlLoad xl) { foreach (Control c in groupBox1.Controls) { SaveLoad.loadControl(xl, c); } foreach (Control c in groupBox2.Controls) { SaveLoad.loadControl(xl, c); } string sVal = ""; if (xl.LoadTextBox("labelDirectory", ref sVal)) { labelDirectory.Text = sVal; } }
public static void loadControl(IControlLoad xl, Control c) { string sVal = ""; bool bVal = false; if (c is TextBox && xl.LoadTextBox(c.Name, ref sVal)) { c.Text = sVal; } else if (c is ComboBox && xl.LoadComboBox(c.Name, ref sVal)) { c.Text = sVal; } else if (c is CheckBox && xl.LoadCheckBox(c.Name, ref bVal)) { (c as CheckBox).Checked = bVal; } }