Esempio n. 1
0
 public static IXmlSynthesizer GetPrefferedXmlSynthesizerForCulture(
     CultureInfo ci,
     IReadOnlyCollection <IXmlSynthesizer> synthesizerList,
     IXmlSynthesizer defaultSynthesizer = null)
 {
     defaultSynthesizer = defaultSynthesizer ?? synthesizerList.FirstOrDefault();
     if (CultureInfo.InvariantCulture.Equals(ci))
     {
         return(defaultSynthesizer);
     }
     return
         (synthesizerList.FirstOrDefault(s => s.VoiceInfo.Culture.Equals(ci))
          ?? synthesizerList.FirstOrDefault(s =>
                                            s.VoiceInfo.Culture.TwoLetterISOLanguageName == ci.TwoLetterISOLanguageName)
          ?? defaultSynthesizer);
 }
Esempio n. 2
0
 public static IXmlSynthesizer GetPrefferedXmlSynthesizerForCulture(CultureInfo ci,
                                                                    IXmlSynthesizer defaultSynthesizer = null)
 {
     return(GetPrefferedXmlSynthesizerForCulture(ci, GetAllSynthesizers().ToList(), defaultSynthesizer));
 }