private void cmdCreatePlaylist_Click(object sender, EventArgs e) { String playlist = Microsoft.VisualBasic.Interaction.InputBox("Playlist Name: ", "Playlist Name"); String owner = Microsoft.VisualBasic.Interaction.InputBox("Owner: ", "Owner"); Guid id = Guid.NewGuid(); List<Song> songs = new List<Song>(); Playlist newPlaylist = new Playlist(playlist, id, owner, songs); PlaylistModel playlistModel = new PlaylistModel(); playlistModel.createPlaylist(newPlaylist); }
private void cmdCreatePlaylist_Click(object sender, EventArgs e) { String playlist = Microsoft.VisualBasic.Interaction.InputBox("Playlist Name: ", "Playlist Name"); Guid id = Guid.NewGuid(); List<Song> songs = new List<Song>(); Playlist newPlaylist = new Playlist(playlist, id, this.currentUser, songs); PlaylistModel playlistModel = new PlaylistModel(); playlistModel.createPlaylist(newPlaylist); playlists.Add(newPlaylist); #region createLabel int count = playlists.Count - 1; Label newLabel = new Label(); newLabel.Text = newPlaylist.getPlaylistName(); newLabel.Size = new Size(400, 30); newLabel.ForeColor = Color.White; newLabel.Tag = count.ToString(); newLabel.Click += playlistSelected; if (count % 2 == 0) { newLabel.BackColor = Color.FromArgb(20, 20, 20); } else { newLabel.BackColor = Color.FromArgb(60, 60, 60); } newLabel.Location = new Point(290, 120 + (count * 30)); newLabel.Font = new System.Drawing.Font("Franklin Gothic Medium", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); labelList.Add(newLabel); this.Controls.Add(labelList[count]); #endregion #region createLabelRemove PictureBox deleteButton = new PictureBox(); deleteButton.Size = new Size(20, 20); deleteButton.Tag = count.ToString(); deleteButton.Click += deletePlaylist; deleteButton.BackgroundImage = Properties.Resources.removeFromPlaylist; deleteButton.BackgroundImageLayout = ImageLayout.Stretch; deleteButton.Location = new Point(700, 125 + (count * 30)); deleteLabels.Add(deleteButton); this.Controls.Add(deleteLabels[count]); #endregion }