示例#1
0
        public void AddImagePath_TestNull()
        {
            MediaFile   file   = null;
            MediaPlayer player = new MediaPlayer();

            player.AddImagePath(file);
        }
示例#2
0
        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));
        }
示例#3
0
        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
                });
            }
        }
示例#4
0
        /// <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);
            }
        }
示例#5
0
        private void btnAddMedia_Click(object sender, RoutedEventArgs e)
        {
            MediaPlayer player = (MediaPlayer)FindResource("player");

            player.AddImagePath((picsPanel.SelectedItem as MediaFile));
        }