public void AddImagePath_TestNull() { MediaFile file = null; MediaPlayer player = new MediaPlayer(); player.AddImagePath(file); }
public void AddImagePath_TestValidMediaFile() { MediaFile file = new MediaFile() { FileName = "filename", ImagePath = "imagepath" }; MediaPlayer player = new MediaPlayer(); player.AddImagePath(file); Assert.IsTrue(player.Album.ContainsFile(file)); }
private void mnuAddFileToSlideShow_Click(object sender, RoutedEventArgs e) { OpenFileDialog dialog = new OpenFileDialog(); dialog.Filter = "Media files (*.jpg, *.png, *.mp4, *.avi, *.mpg) | *.jpg; *.png; *.mp4; *.avi; *.mpg"; if (dialog.ShowDialog() == true) { MediaPlayer player = (MediaPlayer)FindResource("player"); player.AddImagePath(new MediaFile() { FileName = dialog.SafeFileName, ImagePath = dialog.FileName }); } }
/// <summary> /// Hämtar alla mediafiler från valt album i databasen och lägger dessa i MediaPlayer /// </summary> /// <param name="fileName"></param> private void LoadMediaPlayer(string fileName) { MediaPlayer player = (MediaPlayer)FindResource("player"); player.Reset(); player.Album.Name = fileName; List <MediaFile> mediaFiles = ((Repository)FindResource("repository")).GetFilesFromAlbum(fileName); foreach (MediaFile file in mediaFiles) { player.AddImagePath(file); } }
private void btnAddMedia_Click(object sender, RoutedEventArgs e) { MediaPlayer player = (MediaPlayer)FindResource("player"); player.AddImagePath((picsPanel.SelectedItem as MediaFile)); }