예제 #1
0
        private void AddToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SongManagerForm manageSongForm = new SongManagerForm(null);

            if (manageSongForm.ShowDialog() == DialogResult.OK)
            {
                Song newSong = new Song(manageSongForm.GetTitle(), manageSongForm.GetAuthor(), manageSongForm.GetDate(), manageSongForm.GetCategory());
                Document.AddSong(newSong);
            }
        }
예제 #2
0
        private void ModifyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Song            modifiedItem   = (Song)listView.SelectedItems[0].Tag;
            SongManagerForm manageSongForm = new SongManagerForm(modifiedItem);

            if (manageSongForm.ShowDialog() == DialogResult.OK)
            {
                modifiedItem.title    = manageSongForm.GetTitle();
                modifiedItem.author   = manageSongForm.GetAuthor();
                modifiedItem.dateTime = manageSongForm.GetDate();
                modifiedItem.category = manageSongForm.GetCategory();
                Document.UpdateSong(modifiedItem);
            }
        }