Пример #1
0
 private void EditPlaylistWithID(string _id)
 {
     try
     {
         int id = Convert.ToInt32(_id);
         // find current playist in memory
         MusicPlaylist existPlaylist = Program.currentProject.FindPlaylistWithID(id);
         //find all additional data for the given playlist id
         Dictionary <string, MusicPlaylist> nonEngData = Program.currentProject.ReadPlaylistNonEnglishData(id);
         frmAddPlaylist newPllstDlg = new frmAddPlaylist(existPlaylist, false, nonEngData);
         newPllstDlg.Text = "Edit Playlist";
         if (newPllstDlg.ShowDialog(this) == DialogResult.OK)
         {
             if (newPllstDlg.nonEngAdditionalData.Count > 0)
             {
                 Program.currentProject.SavePlaylistsNonEnglishData(newPllstDlg.nonEngAdditionalData);
             }
             this.ApplyChangesOnHardDrive();
         }
         this.UpdateTreesPresentation();
     }
     catch (Exception exp)
     {
         Program.ShowExceptionData(exp);
     }
 }
Пример #2
0
 private void btnAddPlaylist_Click(object sender, EventArgs e)
 {
     try
     {
         int            id          = Program.currentProject.FindLastPlaylistID();
         MusicPlaylist  newPlaylist = new MusicPlaylist(id);
         frmAddPlaylist newPllstDlg = new frmAddPlaylist(newPlaylist, true, null);
         if (newPllstDlg.ShowDialog(this) == DialogResult.OK)
         {
             Program.currentProject.AddPlaylist(newPlaylist);
             if (newPllstDlg.nonEngAdditionalData.Count > 0)
             {
                 Program.currentProject.SavePlaylistsNonEnglishData(newPllstDlg.nonEngAdditionalData);
             }
             this.ApplyChangesOnHardDrive();
         }
         this.UpdateTreesPresentation();
     }
     catch (Exception exp)
     {
         Program.ShowExceptionData(exp);
     }
 }