示例#1
0
        // Shows the Add Songs From Library window with songs from the specified genre
        private void addSongsFromGenreToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // The genre name should be in the Tag
            if (addSongsFromGenreToolStripMenuItem.Tag != null)
            {
                AddSongsForm dialog = new AddSongsForm();
                dialog.InitialGenreFilter = addSongsFromGenreToolStripMenuItem.Tag.ToString();

                ShowAddSongsDialog(dialog);
            }
        }
示例#2
0
        // Shows the Add Songs From Library window
        private void ShowAddSongsDialog(AddSongsForm dialog)
        {
            dialog.Library = Library;
            dialog.Presets = Presets;

            if (dialog.ShowDialog(this) == DialogResult.OK)
            {
                // Add the songs
                Playlist.AddRange(dialog.SelectedSongs);

                // Make the playlist fit to the target size
                Playlist.FitToSize(Presets.TargetSize);

                // Refresh the playlist
                RefreshPlaylist();
            }
        }