Esempio n. 1
0
 private void AddLanguage_Click(object o, RoutedEventArgs e)
 {
     Dictionary.LanguageWindow         languageWindow = new LanguageWindow(Dictionary.LanguageWindow.UseLanguageWindow.CreateLanguage);
     Oggy.Repository.Entities.Language language       = new Language();
     while (languageWindow.ShowDialog().Value)
     {
         languageWindow.LanguageWindowToLanguage(language);
         if (repository.CreateLanguage(language))
         {
             break;
         }
         languageWindow = new LanguageWindow(Dictionary.LanguageWindow.UseLanguageWindow.CreateLanguage, language);
     }
     repository.SetSourceLanguage(language.Code);
     loadAllLanguages();
     loadLanguage();
 }
Esempio n. 2
0
        private void EditLanguage_Click(object o, RoutedEventArgs e)
        {
            Dictionary.LanguageWindow languageWindow = new LanguageWindow(
                Dictionary.LanguageWindow.UseLanguageWindow.UpdateLanguage,
                repository.srcLanguage
                );

            if (!languageWindow.ShowDialog().Value)
            {
                return;
            }

            languageWindow.LanguageWindowToLanguage(repository.srcLanguage);
            languageWindow.Close();
            repository.UpdateLanguage(repository.srcLanguage);
            loadAllLanguages();
            loadLanguage();
        }