public void IdentifierComboBox_SelectBasicOptionsAFewTimes_DoesNotThrow()
 {
     _model.AddPredefinedDefinition(new WritingSystemDefinition("pt"));
     _model.IdentifierNothingSelected();
     _model.IdentifierIpaSelected();
     _model.IdentifierVoiceSelected();
     _model.IdentifierScriptRegionVariantSelected();
     _model.IdentifierNothingSelected();
     _model.IdentifierVoiceSelected();
     _model.IdentifierIpaSelected();
     _model.IdentifierScriptRegionVariantSelected();
     _model.IdentifierNothingSelected();
     _model.IdentifierIpaSelected();
 }
Beispiel #2
0
        private void _scriptsAndVariants_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            // This is a Script link, so for now we'll limit the dialog to only the ScriptRegionVariant combo option.
            var wsSetupModel = new WritingSystemSetupModel(new WritingSystemDefinition(_model.SelectedLanguage.LanguageTag),
                                                           WritingSystemSetupModel.SelectionsForSpecialCombo.ScriptRegionVariant, false);

            wsSetupModel.IdentifierScriptRegionVariantSelected();
            using (var dlg = new ScriptsAndVariantsDialog())
            {
                dlg.BindToModel(wsSetupModel);
                if (dlg.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
                // Allow the user to think of the the Script and Variant's Abbreviation as the primary language tag
                // for unlisted languages.  Otherwise, why show it or allow it to be edited?
                var tag  = wsSetupModel.CurrentDefinition.LanguageTag;
                var abbr = wsSetupModel.CurrentDefinition.Abbreviation;
                if (tag.Length >= 3 && LanguageSubtag.IsUnlistedCode(tag.Substring(0, 3)) &&
                    abbr.Length == 3 && LanguageSubtag.IsUnlistedCode(abbr) &&
                    abbr != tag.Substring(0, 3))
                {
                    tag = abbr + tag.Substring(3);
                }
                _model.SelectedLanguage.LanguageTag = tag;
                UpdateReadiness();
            }
        }
 public void Selected()
 {
     if (_model != null)
     {
         _model.IdentifierScriptRegionVariantSelected();
     }
     UpdateDisplayFromModel(null, null);
 }
Beispiel #4
0
        private void _scriptsAndVariants_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            // This is a Script link, so for now we'll limit the dialog to only the ScriptRegionVariant combo option.
            var wsSetupModel = new WritingSystemSetupModel(new WritingSystemDefinition(_model.SelectedLanguage.LanguageTag),
                                                           WritingSystemSetupModel.SelectionsForSpecialCombo.ScriptRegionVariant, false);

            wsSetupModel.IdentifierScriptRegionVariantSelected();
            using (var dlg = new ScriptsAndVariantsDialog())
            {
                dlg.BindToModel(wsSetupModel);
                if (dlg.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
                _model.SelectedLanguage.LanguageTag = wsSetupModel.CurrentDefinition.LanguageTag;
                UpdateReadiness();
            }
        }