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); }
public static IXmlSynthesizer GetPrefferedXmlSynthesizerForCulture(CultureInfo ci, IXmlSynthesizer defaultSynthesizer = null) { return(GetPrefferedXmlSynthesizerForCulture(ci, GetAllSynthesizers().ToList(), defaultSynthesizer)); }