private void Options_Load(object sender, EventArgs e) { ClassOptions classOptions = Options_Control.GetClassOptions; ВыборДняНедели.SelectedIndex = classOptions.FirstDay; NoAlarm.Checked = classOptions.NotAlarm; NumberWeeks.Checked = classOptions.NumberWeeks; }
public void Load(ref ClassOptions classOptions) { try { var formatter = new BinaryFormatter(); using (var fs = new FileStream("config.bin", FileMode.Open)) { classOptions = (ClassOptions)formatter.Deserialize(fs); } } catch { classOptions = new ClassOptions(); } }
public static void NewOption(int firstday, bool notalarm, bool numberweeks) { options = new ClassOptions(firstday, notalarm, numberweeks); }