public EditPreferredLanguageWindow(LanguageInfo li)
        {
            try
            {
                InitializeComponent();
                this.li = new LanguageInfo(li);

                textBoxLanguage.Text      = li.language;
                textBoxTranslation.Text   = li.translation;
                textBoxLanguageShort.Text = li.languageShort;
            }
            catch (Exception ex)
            {
                Global.ErrorMsg(ex);
            }
        }
        public EditPreferredLanguageWindow(LanguageInfo li)
        {            
            try
            {
                InitializeComponent();
                this.li = new LanguageInfo(li);

                textBoxLanguage.Text = li.language;
                textBoxTranslation.Text = li.translation;
                textBoxLanguageShort.Text = li.languageShort;
            }
            catch (Exception ex)
            {
                Global.ErrorMsg(ex);
            }
        }
 private void buttonPreferredSubLanguagesDown_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         int index = listBoxPreferredSubLanguages.SelectedIndex;
         if (index < settings.preferredSubtitleLanguages.Count - 1)
         {
             LanguageInfo li = settings.preferredSubtitleLanguages[index];
             settings.preferredSubtitleLanguages.RemoveAt(index);
             settings.preferredSubtitleLanguages.Insert(index + 1, li);
             UpdatePreferredSub();
             listBoxPreferredSubLanguages.SelectedIndex = index + 1;
         }
     }
     catch (Exception)
     {
     }
 }
 private void buttonPreferredAudioLanguagesUp_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         int index = listBoxPreferredAudioLanguages.SelectedIndex;
         if (index > 0)
         {
             LanguageInfo li = settings.preferredAudioLanguages[index];
             settings.preferredAudioLanguages.RemoveAt(index);
             settings.preferredAudioLanguages.Insert(index - 1, li);
             UpdatePreferredAudio();
             listBoxPreferredAudioLanguages.SelectedIndex = index - 1;
         }
     }
     catch (Exception)
     {
     }
 }
 private void buttonPreferredSubLanguagesAdd_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         LanguageInfo li = new LanguageInfo();
         li.language = Global.Res("NewLanguage");
         EditPreferredLanguageWindow eplw = new EditPreferredLanguageWindow(li);
         eplw.ShowDialog();
         if (eplw.DialogResult == true)
         {
             li = new LanguageInfo(eplw.languageInfo);
             settings.preferredSubtitleLanguages.Add(li);
             UpdatePreferredSub();
         }
     }
     catch (Exception)
     {
     }
 }
 private void buttonPreferredSubLanguagesAdd_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         LanguageInfo li = new LanguageInfo();
         li.language = Global.Res("NewLanguage");
         EditPreferredLanguageWindow eplw = new EditPreferredLanguageWindow(li);
         eplw.ShowDialog();
         if (eplw.DialogResult == true)
         {
             li = new LanguageInfo(eplw.languageInfo);
             settings.preferredSubtitleLanguages.Add(li);
             UpdatePreferredSub();
         }
     }
     catch (Exception)
     {
     }
 }
Example #7
0
 public LanguageInfo(LanguageInfo orig)
 {
     this.language = orig.language;
     this.translation = orig.translation;
     this.languageShort = orig.languageShort;
 }
Example #8
0
 public LanguageInfo(LanguageInfo orig)
 {
     this.language      = orig.language;
     this.translation   = orig.translation;
     this.languageShort = orig.languageShort;
 }