public override WritingSystemDefinition ShowDialogIfNeededAndGetDefinition()
        {
            WritingSystemDefinition ws = WritingSystemFactory.Create(_templateWritingSystemDefinition);

            ws.IsVoice = true;
            return(ws);
        }
 public override WritingSystemDefinition ShowDialogIfNeededAndGetDefinition()
 {
     WaitCursor.Show();
     try
     {
         var variants = new List <VariantSubtag> {
             WellKnownSubtags.IpaVariant
         };
         variants.AddRange(_templateWritingSystemDefinition.Variants);
         WritingSystemDefinition ws;
         WritingSystemFactory.Create(IetfLanguageTag.Create(_templateWritingSystemDefinition.Language, null,
                                                            _templateWritingSystemDefinition.Region, variants), out ws);
         string ipaFontName = _fontsForIpa.FirstOrDefault(FontExists);
         if (!string.IsNullOrEmpty(ipaFontName))
         {
             ws.DefaultFont = new FontDefinition(ipaFontName);
         }
         ws.Abbreviation    = "ipa";
         ws.DefaultFontSize = _templateWritingSystemDefinition.DefaultFontSize;
         IKeyboardDefinition ipaKeyboard = Keyboard.Controller.AvailableKeyboards.FirstOrDefault(k => k.Id.ToLower().Contains("ipa"));
         if (ipaKeyboard != null)
         {
             ws.Keyboard = ipaKeyboard.Id;
         }
         return(ws);
     }
     finally
     {
         WaitCursor.Hide();
     }
 }
        public override WritingSystemDefinition ShowDialogIfNeededAndGetDefinition()
        {
            WritingSystemDefinition ws = WritingSystemFactory.Create(_templateWritingSystemDefinition);

            ws.LanguageTag = IetfLanguageTag.ToUniqueLanguageTag(
                ws.LanguageTag, _existingWritingSystemsForLanguage.Select(w => w.LanguageTag));
            return(ws);
        }
        public override WritingSystemDefinition ShowDialogIfNeededAndGetDefinition()
        {
            var dlg = new GetDialectNameDialog();

            if (DialogResult.OK != dlg.ShowDialog())
            {
                return(null);
            }

            WritingSystemDefinition     ws = WritingSystemFactory.Create(_templateWritingSystemDefinition);
            IEnumerable <VariantSubtag> variantSubtags;

            if (IetfLanguageTag.TryGetVariantSubtags(dlg.DialectName.ToValidVariantString(), out variantSubtags))
            {
                ws.Variants.ReplaceAll(variantSubtags);
            }
            return(ws);
        }