Beispiel #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();
        }
        /// ------------------------------------------------------------------------------------
        public override string SetStringValue(string key, string newValue)
        {
            if (key == SessionFileType.kStatusFieldName)
            {
                newValue = Session.GetStatusAsEnumParsableString(newValue);
            }
            else if (key == SessionFileType.kGenreFieldName)
            {
                newValue = GenreDefinition.TranslateNameToId(newValue);
            }
            else if (key == PersonFileType.kCode)
            {
                _oldUiId = ParentElement.UiId;
            }

            return(base.SetStringValue(key, newValue));
        }