Esempio n. 1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Update the tab text in case it was localized.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        protected override void HandleStringsLocalized()
        {
            TabText = LocalizationManager.GetString("SessionsView.MetadataEditor.TabText", "Session");
            if (_genre != null && !String.IsNullOrEmpty(_genre.Text))
            {
                var genreId = GenreDefinition.TranslateNameToId(_genre.Text);
                if (genreId != _genre.Text)
                {
                    _genre.Text = GenreDefinition.TranslateIdToName(genreId);
                }
            }

            if (_gridAdditionalFields != null)
            {
                for (int iRow = 0; iRow < _gridAdditionalFields.RowCount; iRow++)
                {
                    DataGridViewComboBoxCell comboBoxCell = _gridAdditionalFields[1, iRow] as DataGridViewComboBoxCell;
                    if (comboBoxCell != null)
                    {
                        IMDIItemList list = comboBoxCell.DataSource as IMDIItemList;
                        if (list != null)
                        {
                            list.Localize(Localize);
                        }
                    }
                }
            }
            base.HandleStringsLocalized();
        }
Esempio n. 2
0
        /// ------------------------------------------------------------------------------------
        private void ResetCountryList()
        {
            //int iCountry = _country.SelectedIndex;
            var selectedCountry = _country.SelectedItem as IMDIListItem;

            //_country.Items.Clear();
            _country.DataSource = null;
            _countryList.Localize(Localize);
            _countryList.Sort();
            //_country.Items.AddRange(_countryList.Select(c => c.Text).Cast<object>().ToArray());

            _country.DataSource    = _countryList;
            _country.DisplayMember = "Text";
            _country.ValueMember   = "Value";

            if (selectedCountry != null)
            {
                _country.SelectedItem = _countryList.FindByValue(selectedCountry.Value);
            }
        }