Esempio n. 1
0
        private void SelectedLanguageChanged()
        {
            _mainViewModel.UpdateLanguage();
            _instance.RepopulateTreeView();
            foreach (MenuItem item in LanguageMenu.Items)
            {
                if (item.Header.ToString() == SelectedLanguage)
                {
                    item.IsChecked = true;
                }
                else
                {
                    item.IsChecked = false;
                }
            }

            _mainViewModel.BuildingSettingsViewModel.UpdateLanguageBuildingInfluenceType();

            //Force a language update on the clipboard status item.
            if (StatusBarItemClipboardStatus.Content != null)
            {
                ClipboardChanged(annoCanvas.ObjectClipboard);
            }

            //update settings
            Settings.Default.SelectedLanguage = SelectedLanguage;

            _mainViewModel.UpdateStatistics();

            _mainViewModel.PresetsTreeSearchViewModel.SearchText = string.Empty;
        }
Esempio n. 2
0
        //About window does not need to be called, as it get's instantiated and used when the about window is created

        private void SelectedLanguageChanged()
        {
            mainWindowLocalization.UpdateLanguage();
            _instance.RepopulateTreeView();
            foreach (MenuItem item in LanguageMenu.Items)
            {
                if (item.Header.ToString() == SelectedLanguage)
                {
                    item.IsChecked = true;
                }
                else
                {
                    item.IsChecked = false;
                }
            }
            Settings.Default.SelectedLanguage = SelectedLanguage;
        }
Esempio n. 3
0
        //About window does not need to be called, as it get's instantiated and used when the about window is created

        private void SelectedLanguageChanged()
        {
            _mainWindowLocalization.UpdateLanguage();
            _instance.RepopulateTreeView();
            foreach (MenuItem item in LanguageMenu.Items)
            {
                if (item.Header.ToString() == SelectedLanguage)
                {
                    item.IsChecked = true;
                }
                else
                {
                    item.IsChecked = false;
                }
            }

            //refresh localized influence types in combo box
            comboxBoxInfluenceType.Items.Clear();
            string[] rangeTypes = Enum.GetNames(typeof(BuildingInfluenceType));
            string   language   = Localization.Localization.GetLanguageCodeFromName(SelectedLanguage);

            foreach (string rangeType in rangeTypes)
            {
                comboxBoxInfluenceType.Items.Add(new KeyValuePair <BuildingInfluenceType, string>((BuildingInfluenceType)Enum.Parse(typeof(BuildingInfluenceType), rangeType), Localization.Localization.Translations[language][rangeType]));
            }
            comboxBoxInfluenceType.SelectedIndex = 0;

            //Force a language update on the clipboard status item.
            if (StatusBarItemClipboardStatus.Content != null)
            {
                ClipboardChanged(annoCanvas.ObjectClipboard);
            }

            //update settings
            Settings.Default.SelectedLanguage = SelectedLanguage;

            _mainWindowLocalization.StatisticsViewModel.UpdateStatistics(annoCanvas.PlacedObjects,
                                                                         annoCanvas.SelectedObjects,
                                                                         annoCanvas.BuildingPresets);

            _mainWindowLocalization.TreeViewSearchText = string.Empty;
        }