Esempio n. 1
0
        private void AddSongFunction()
        {
            AddForm newSongForm = new AddForm(null, songViewDoc.songList_);

            if (newSongForm.ShowDialog() == DialogResult.OK)
            {
                Song newSong = new Song(newSongForm.SongTitle, newSongForm.SongAuthor, newSongForm.SongDate, newSongForm.SongGenre);
                songViewDoc.AddSong(newSong);
            }
        }
Esempio n. 2
0
        private void EditSongFunction()
        {
            if (songListView.SelectedItems.Count == 0)
            {
                return;
            }
            Song    song         = (Song)songListView.SelectedItems[0].Tag;
            AddForm editSongForm = new AddForm(song, songViewDoc.songList_);

            if (editSongForm.ShowDialog() == DialogResult.OK)
            {
                Song newSong = new Song(editSongForm.SongTitle, editSongForm.SongAuthor, editSongForm.SongDate, editSongForm.SongGenre);
                songViewDoc.UpdateSong(song, newSong);
            }
        }