Beispiel #1
0
        private void addFileToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog openSongs = new OpenFileDialog();

            openSongs.Multiselect = true;
            openSongs.Filter      = "*.mp3|*.mp3";

            if (openSongs.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                foreach (string file in openSongs.FileNames)
                {
                    Library.insert(file);

                    if (playlistSelected)
                    {
                        Playlist.addToPlalist(Playlist.getPlaylistID(treeView1.SelectedNode.Text), Library.getSongID(file));
                    }

                    if (playlistView)
                    {
                        Playlist.addToPlalist(Playlist.getPlaylistID(playlistName), Library.getSongID(file));
                    }
                }

                reloadList();
            }
        }
Beispiel #2
0
        private void deleteSelectedToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            foreach (ListViewItem item in songLibrary.SelectedItems)
            {
                if (playlistSelected)
                {
                    Playlist.DeleteFromPlaylist(Playlist.getPlaylistID(treeView1.SelectedNode.Text), Library.getSongID(item.Tag.ToString()));
                }
                else if (playlistView)
                {
                    Playlist.DeleteFromPlaylist(Playlist.getPlaylistID(playlistName), Library.getSongID(item.Tag.ToString()));
                }
                else
                {
                    songLibrary.Items.Remove(item);
                    Library.deleteSong(item.Tag.ToString());
                }
            }

            reloadList();
        }