Esempio n. 1
0
        private void updateTranslationsList(bool refresh)
        {
            object selectedItem = this.cbActiveTranslation.SelectedItem;

            this.cbActiveTranslation.Items.Clear();
            if (refresh)
            {
                TranslationManager.RefreshAvailableTranslations();
            }
            List <TranslationManager.TranslationCulture> avaliableTranslations = TranslationManager.AvaliableTranslations;

            if (avaliableTranslations.Count > 0)
            {
                this.cbActiveTranslation.Items.AddRange(avaliableTranslations.ToArray());
                if (!refresh)
                {
                    selectedItem = avaliableTranslations[avaliableTranslations.Count - 1];
                }
                if (selectedItem != null)
                {
                    this.cbActiveTranslation.SelectedItem = selectedItem;
                    return;
                }
                this.cbActiveTranslation.SelectedIndex = 0;
            }
        }