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; }
private void RemoveImage(object sender, RoutedEventArgs e) { if (artistListListBox.SelectedIndex != -1) { Album album = artistListListBox.Items.GetItemAt(artistListListBox.SelectedIndex) as Album; try { File.Delete(mediaFolder + "//ZdjeciaArtysty//" + album.Name.Remove(album.Name.Length - 2) + ".png"); allCollections = new MyData(songList, pathList, albumImageList, artistImageList, nameAlbumImageList, nameArtistImageList); artistListListBox.ItemsSource = allCollections.GetArtists(); } catch (IOException iox) { Console.WriteLine(iox.Message); } } }