Пример #1
0
        private void openLanguageDialog()
        {
            MessageBoxResult res = MessageBox.Show(
                "Only change the language properties if you know what you are doing" +
                " or the language you are translating was never uploaded before!", "Proceed?",
                MessageBoxButton.OKCancel);

            if (res == MessageBoxResult.OK)
            {
                LanguagePropertyDialog lpd = new LanguagePropertyDialog(name: loadedFile.Language.Name,
                                                                        owner: loadedFile.Language.Owner, _base: loadedFile.Language.Base,
                                                                        variant: loadedFile.Language.Variant);
                if (lpd.ShowDialog() == true)
                {
                    loadedFile.Language.Base    = lpd.LanguageBase;
                    loadedFile.Language.Name    = lpd.LanguageName;
                    loadedFile.Language.Owner   = lpd.LanguageOwner;
                    loadedFile.Language.Variant = lpd.LanguageVariant;
                }
            }
        }
Пример #2
0
        private void newFile()
        {
            MessageBoxResult result = MessageBox.Show(
                "Use the english file as a blueprint?", "New File", MessageBoxButton.YesNo);

            if (result == MessageBoxResult.Yes)
            {
                loadedFile = new XmlStrings();
                try
                {
                    getFileFromScratch();
                }
                catch
                {
                    MessageBox.Show("Failed to load blueprint, connect to the internet and restart.");
                }
                currentStringsList.Clear();
                foreach (XmlString s in loadedFile.Strings)
                {
                    s.Description = getDescription(s.Key);
                }
                currentStringsList = loadedFile.Strings;
            }
            fileIsOpen     = true;
            textHasChanged = true;
            LanguagePropertyDialog lpd = new LanguagePropertyDialog(firstTime: true);

            if (lpd.ShowDialog() == true)
            {
                loadedFile.Language.Base    = lpd.LanguageBase;
                loadedFile.Language.Name    = lpd.LanguageName;
                loadedFile.Language.Owner   = lpd.LanguageOwner;
                loadedFile.Language.Variant = lpd.LanguageVariant;
            }
            listItemsView.ItemsSource = currentStringsList;
            updateStatus();
        }