public void Initialize(FormHello form) { try { var loader = new TestLoader(); var tests = loader.LoadTestsFromFolder(new DynamicParams().GetPath()); VzvodAndLs.Set(tests.PlatoonList); Courses.Set(tests.CourseList); } catch (Exception) { } }
private void buttonCourseSave_Click(object sender, EventArgs e) { Courses.Set(listOfCourses); labelCoursesAreSaved.Visible = true; ((ComboBox)(_formHello.Controls.Find("comboBoxCourseFilter", true)[0])).Items.Clear(); ((ComboBox)(_formHello.Controls.Find("comboBoxCourseFilter", true)[0])).Items.AddRange(Courses.Get().ToArray()); //_formHello.listOfCourses = listOfCourses; //this.Visible = false; //_formHello.Visible = true; //KeyValuePair<Panel, Test> keyValue in ListTests foreach (KeyValuePair <Panel, FormChooseTestName> formCTN in _formHello.ListMarksAndName) { ComboBox currentCB = (ComboBox)formCTN.Value.Controls.Find("comboBoxCourse", true)[0]; if (currentCB.SelectedItem != null) { string bufItem = currentCB.SelectedItem.ToString(); currentCB.Items.Clear(); currentCB.Items.AddRange(Courses.Get().ToArray()); currentCB.SelectedItem = Courses.Get().Find(x => (x == bufItem)); } } }