Example #1
0
        private void DeletePlaylistToolStripMenuItem_Click(object sender, EventArgs e)
        {
            IWMPPlaylist playlistForDeletion = MediaPlayer.playlistCollection.getByName(libraryListBox.GetItemText(libraryListBox.SelectedItem)).Item(0); // find playlist for deletion

            MediaPlayer.playlistCollection.remove(playlistForDeletion);                                                                                   // delete selected playlist

            MediaPlayer.close();
            MediaPlayer.currentPlaylist.clear();
            libraryListBox.Items.Clear();
            playlistListBox.Items.Clear();
            playListLabel.Text = "Unsaved Playlist";
            IWMPPlaylistArray allPlaylists = MediaPlayerHelper.SetupLibrary(libraryListBox, MediaPlayer); // refresh libarary
        }
Example #2
0
        // saves playlist
        private void SavePlaylistToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SavePlaylistForm saveForm = new SavePlaylistForm
            {
                StartPosition = FormStartPosition.CenterParent
            }; // launches save form

            saveForm.ShowDialog();

            if (saveForm.DialogResult == DialogResult.OK)
            {
                // saves current playlist
                playlist           = MediaPlayer.currentPlaylist;
                playlist.name      = saveForm.PlaylistName;
                playListLabel.Text = saveForm.PlaylistName;              // get playlist name
                MediaPlayer.playlistCollection.importPlaylist(playlist); // adds playlist to library

                //refresh library
                libraryListBox.Items.Clear();
                MediaPlayerHelper.SetupLibrary(libraryListBox, MediaPlayer);
            }
        }
Example #3
0
 private void MainForm_Load(object sender, EventArgs e)
 {
     MediaPlayerHelper.SetupLibrary(libraryListBox, MediaPlayer); // setup playlist on load
 }