Esempio n. 1
0
 private void additionalLangRecord_EditButton_Click(object sender, LabelEditEventArgs e)
 {
     try
     {
         MovieFile         temp      = nonEngAdditionalData[e.Label];
         frmAddNewLanguage frmNewDlg = new frmAddNewLanguage(e.Label, temp.title, temp.artist, temp.description);
         if (frmNewDlg.ShowDialog(this) == DialogResult.OK)
         {
             temp.title       = frmNewDlg.InsertedTitle;
             temp.artist      = frmNewDlg.InsertedArtists;
             temp.description = frmNewDlg.InsertedDescription;
         }
         UpdateLangsPanel();
     }
     catch (Exception exp)
     {
         Program.ShowExceptionData(exp);
     }
 }
Esempio n. 2
0
 private void btnNewLang_Click(object sender, EventArgs e)
 {
     try
     {
         // fetch which additional langs already filled for current playlist
         string[] existlangs = new string[nonEngAdditionalData.Count];
         int      i          = 0;
         foreach (var item in nonEngAdditionalData)
         {
             existlangs[i++] = item.Key;
         }
         // if all additional langs already filled, no action occurred
         if (existlangs.Length == Enum.GetValues(typeof(Languages)).Length)
         {
             return;
         }
         frmAddNewLanguage newDlg = new frmAddNewLanguage(!EnglishMoreDataExist(), existlangs);
         if (newDlg.ShowDialog(this) == DialogResult.OK)
         {
             MovieFile p = new MovieFile(movieToComplete.id);
             p.title       = newDlg.InsertedTitle;
             p.artist      = newDlg.InsertedArtists;
             p.description = newDlg.InsertedDescription;
             if (nonEngAdditionalData.ContainsKey(newDlg.SelectedLanguage))
             {
                 nonEngAdditionalData.Remove(newDlg.SelectedLanguage);
             }
             nonEngAdditionalData.Add(newDlg.SelectedLanguage, p);
         }
         UpdateLangsPanel();
     }
     catch (Exception exp)
     {
         Program.ShowExceptionData(exp);
     }
 }