Beispiel #1
0
        private void RemoveCover(object sender, RoutedEventArgs e)
        {
            if (albumListBox.SelectedIndex != -1)
            {
                Album album = albumListBox.Items.GetItemAt(albumListBox.SelectedIndex) as Album;

                try
                {
                    File.Delete(mediaFolder + "//Okladki//" + album.Name.Remove(album.Name.Length - 2) + ".png");
                    allCollections           = new MyData(songList, pathList, albumImageList, artistImageList, nameAlbumImageList, nameArtistImageList);
                    albumListBox.ItemsSource = allCollections.GetAlbums();
                }
                catch (IOException iox)
                {
                    Console.WriteLine(iox.Message);
                }
            }
        }
Beispiel #2
0
        public CollectionMusicWindow(String path)
        {
            InitializeComponent();
            selected    = false;
            mediaFolder = path;

            Utility.CheckExistDirectories(path);
            Utility.LoadingMp3(path, pathList, songList);
            Utility.LoadingImages(path + "//Okladki", albumImageList, nameAlbumImageList);
            Utility.LoadingImages(path + "//ZdjeciaArtysty", artistImageList, nameArtistImageList);

            allCollections                = new MyData(songList, pathList, albumImageList, artistImageList, nameAlbumImageList, nameArtistImageList);
            albumCollection               = new MyData(songList, pathList, albumImageList, nameAlbumImageList);
            playlistCollection            = new MyData(mediaFolder);
            albumListBox.ItemsSource      = allCollections.GetAlbums();
            artistListListBox.ItemsSource = allCollections.GetArtists();
            playlistListBox.ItemsSource   = playlistCollection.GetPlaylists();
            allSongsListBox.ItemsSource   = allCollections.GetSongs();
            wyborWykonawcy.ItemsSource    = allCollections.GetArtists();
            grupowanie.SelectedIndex      = 0;
            grupowanie2.SelectedIndex     = 0;
        }