private void loadVideos() { try { string[] paths = VideoActions.openFile(); foreach (string path in paths) { UC_VideoPlayer video = new UC_VideoPlayer(path); if(VideoActions.getMyVideoActions().addVideo(video)) { videoContainer.addToAnchorablePane(video, video.VideoName); } } } catch (NotImplementedException ex) { System.Console.WriteLine(ex.StackTrace); } catch (FileNotSelectedException ex2) { Console.WriteLine(ex2.StackTrace); } }
/// <summary> /// Event that handles where the video should begin and which video has to be taken as /// reference, this event is called whenever the user clicks on the Start here button in any /// UC_VideoPlayer /// </summary> /// <param name="sender">The UC_VideoPlayer that generated this event</param> /// <param name="e"></param> private void video_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { if (e.PropertyName == "StartHere") { startReference = ((UC_VideoPlayer)sender).StartHere; referenceVideo = (UC_VideoPlayer)sender; } }
/// <summary> /// Adds the UC_VideoPlayer to the loaded videos /// </summary> /// <param name="video">The UC_VideoPlayer to be added</param> public bool addVideo(UC_VideoPlayer video) { video.PropertyChanged += video_PropertyChanged; return videos.Add(video); }
internal bool removeVideo(UC_VideoPlayer video) { video.stop(); return videos.Remove(video); }