Пример #1
0
        private void CreateSong(object sender, EventArgs e)
        {
            var dlg = new SongMaintenance();

            dlg.ShowDialog();
            LoadSongList();
            EnableButtons(sender, e);
        }
Пример #2
0
        private void EditSong(object sender, EventArgs e)
        {
            var lastSubItem = SongList.SelectedItems[0].SubItems.Count - 1;
            var SongId      = int.Parse(SongList.SelectedItems[0].SubItems[lastSubItem].Text);
            var dlg         = new SongMaintenance(SongId, Modes.Edit);

            dlg.ShowDialog();
            LoadSongList();
            EnableButtons(sender, e);
        }
Пример #3
0
        private void DeleteSong(object sender, EventArgs e)
        {
            var lastSubItem = SongList.SelectedItems[0].SubItems.Count - 1;
            var SongId      = int.Parse(SongList.SelectedItems[0].SubItems[lastSubItem].Text);
            var dlg         = new SongMaintenance(SongId, Modes.Delete);

            dlg.ShowDialog();
            LoadSongList();
            EnableButtons(sender, e);
            //SongSelectedEventArgs s = new SongSelectedEventArgs();
            //var lastSubItem = SongList.SelectedItems[0].SubItems.Count - 1;
            //var id = int.Parse(SongList.SelectedItems[0].SubItems[lastSubItem].Text);
            //s.Mode = (int)Modes.Delete;
            //s.SongId = id;
            //s.Filename = SongLibrary.Songs.Where(T => T.Id == id).FirstOrDefault().Filepath;
            //OnSongSelected(s);
            ////Close();
        }