private bool video_exists(Hazard_video h_new) { foreach (Hazard_video h in hazard_videos) { if (h.filename == h_new.filename) { return(true); } } return(false); }
private void find_videos_and_add() { if (!Directory.Exists("videos/")) { Directory.CreateDirectory("videos/"); } foreach (string v in Directory.GetFiles("videos/", "*.wmv")) { Hazard_video h = new Hazard_video(); h.filename = v; if (!video_exists(h)) { hazard_videos.Add(h); } } load_videos_ui(); save_state(); }
private void lstVideos_SelectedIndexChanged(object sender, EventArgs e) { if (lstVideos.SelectedIndex >= 0) { current_video = null; foreach (Hazard_video h in hazard_videos) { if (h.filename == lstVideos.SelectedItem.ToString()) { current_video = h; begin_video(); load_hazards(); } } if (current_video == null) { throw new Exception("Chosen video not loaded."); } } }
private void continue_test() { if (panel3.Visible == false) { wmp.uiMode = "None"; } ; foreach (Hazard_test_question q in current_hazard_test.hazard_test_questions) { if (q.finished == false) { current_hazard_test_question = q; current_video = q.video; load_hazards(); wmp.URL = q.video.filename; wmp.stretchToFit = true; panel1.Visible = true; pNextQuestion.Visible = false; timer1.Enabled = true; return; } } do_test_finished(); }
private bool video_exists(Hazard_video h_new) { foreach (Hazard_video h in hazard_videos) { if (h.filename == h_new.filename) { return true; } } return false; }
private void continue_test() { if (panel3.Visible == false) { wmp.uiMode = "None"; }; foreach (Hazard_test_question q in current_hazard_test.hazard_test_questions) { if (q.finished == false) { current_hazard_test_question = q; current_video = q.video; load_hazards(); wmp.URL = q.video.filename; wmp.stretchToFit = true; panel1.Visible = true; pNextQuestion.Visible = false; timer1.Enabled = true; return; } } do_test_finished(); }