Ejemplo n.º 1
0
        public override bool Equals(object obj)
        {
            InstalledVoice installedVoice = obj as InstalledVoice;

            if (installedVoice == null)
            {
                return(false);
            }
            if (VoiceInfo.Name == installedVoice.VoiceInfo.Name && VoiceInfo.Age == installedVoice.VoiceInfo.Age && VoiceInfo.Gender == installedVoice.VoiceInfo.Gender)
            {
                return(VoiceInfo.Culture.Equals(installedVoice.VoiceInfo.Culture));
            }
            return(false);
        }
Ejemplo n.º 2
0
        internal static InstalledVoice FirstEnabled(List <InstalledVoice> list, CultureInfo culture)
        {
            InstalledVoice installedVoice = null;

            foreach (InstalledVoice item in list)
            {
                if (item.Enabled)
                {
                    if (Helpers.CompareInvariantCulture(item.VoiceInfo.Culture, culture))
                    {
                        return(item);
                    }
                    if (installedVoice == null)
                    {
                        installedVoice = item;
                    }
                }
            }
            return(installedVoice);
        }